All Downloads are FREE. Search and download functionalities are using the official Maven repository.

simplenlg.format.english.MarkupSyntaxProcessor Maven / Gradle / Ivy

There is a newer version: 2.2.0
Show newest version
package simplenlg.format.english;

import nlg.wrapper.Constants;
import simplenlg.framework.NLGElement;
import simplenlg.syntax.english.SyntaxProcessor;

import static simplenlg.format.english.MarkupFormatter.debug_println;

public class MarkupSyntaxProcessor extends SyntaxProcessor {
    @Override
    public NLGElement realise(NLGElement element) {
        NLGElement realised = super.realise(element);
        if (realised!=null) {
            debug_println("{{{ ***** Syntax }}}" + element.getFeatureAsString(Constants.MARKUP_ELEMENT)+ " " + element.getCategory() + " " + element.getClass() + " " + element);
            MarkupMorphologyProcessor.propagateMarkup(element, realised);
            debug_println("    -> {{{ ***** Syntax }}} " + realised.getFeatureAsString(Constants.MARKUP_ELEMENT) + " " + realised.getCategory() + " " + realised.getClass() + " " + realised);
            debug_println("    ->\n  " + realised.printTree("  "));
        }

        return realised;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy