Search in sources :

Example 21 with TextAnnotationBuilder

use of edu.illinois.cs.cogcomp.annotation.TextAnnotationBuilder in project cogcomp-nlp by CogComp.

the class MultilingualEreReaderTest method testSpanish.

public static void testSpanish() {
    // String lang = "es"; //spanish
    // TextAnnotationBuilder taBldr = MultiLingualTokenizer.getTokenizer(lang);
    EREEventReader reader = null;
    try {
        boolean throwExceptionOnXmlParseFail = true;
        TextAnnotationBuilder spanishTaBldr = MultiLingualTokenizer.getTokenizer(Language.Spanish.getCode());
        reader = new EREEventReader(EREDocumentReader.EreCorpus.ENR2, spanishTaBldr, spanishPathA, throwExceptionOnXmlParseFail);
    } catch (Exception e) {
        e.printStackTrace();
        fail(e.getMessage());
    }
    testReader(reader);
}
Also used : TextAnnotationBuilder(edu.illinois.cs.cogcomp.annotation.TextAnnotationBuilder) EREEventReader(edu.illinois.cs.cogcomp.nlp.corpusreaders.ereReader.EREEventReader)

Example 22 with TextAnnotationBuilder

use of edu.illinois.cs.cogcomp.annotation.TextAnnotationBuilder in project cogcomp-nlp by CogComp.

the class ClauseAnnotatorFactory method buildPipeline.

/**
 * @param rm non-default config options
 * @return AnnotatorService with specified NLP components
 * @throws IOException
 * @throws AnnotatorException
 */
public static BasicAnnotatorService buildPipeline(ResourceManager rm) throws IOException, AnnotatorException {
    TextAnnotationBuilder taBldr = new TokenizerTextAnnotationBuilder(new StatefulTokenizer(false, false));
    Map<String, Annotator> annotators = buildAnnotators();
    return new BasicAnnotatorService(taBldr, annotators, rm);
}
Also used : TextAnnotationBuilder(edu.illinois.cs.cogcomp.annotation.TextAnnotationBuilder) TokenizerTextAnnotationBuilder(edu.illinois.cs.cogcomp.nlp.utility.TokenizerTextAnnotationBuilder) Annotator(edu.illinois.cs.cogcomp.annotation.Annotator) TokenizerTextAnnotationBuilder(edu.illinois.cs.cogcomp.nlp.utility.TokenizerTextAnnotationBuilder) StatefulTokenizer(edu.illinois.cs.cogcomp.nlp.tokenizer.StatefulTokenizer) BasicAnnotatorService(edu.illinois.cs.cogcomp.annotation.BasicAnnotatorService)

Aggregations

TextAnnotationBuilder (edu.illinois.cs.cogcomp.annotation.TextAnnotationBuilder)22 TokenizerTextAnnotationBuilder (edu.illinois.cs.cogcomp.nlp.utility.TokenizerTextAnnotationBuilder)20 StatefulTokenizer (edu.illinois.cs.cogcomp.nlp.tokenizer.StatefulTokenizer)16 TextAnnotation (edu.illinois.cs.cogcomp.core.datastructures.textannotation.TextAnnotation)15 AnnotatorException (edu.illinois.cs.cogcomp.annotation.AnnotatorException)7 POSAnnotator (edu.illinois.cs.cogcomp.pos.POSAnnotator)7 Constituent (edu.illinois.cs.cogcomp.core.datastructures.textannotation.Constituent)6 ResourceManager (edu.illinois.cs.cogcomp.core.utilities.configuration.ResourceManager)6 Properties (java.util.Properties)6 Test (org.junit.Test)5 ChunkerAnnotator (edu.illinois.cs.cogcomp.chunker.main.ChunkerAnnotator)3 ChunkerConfigurator (edu.illinois.cs.cogcomp.chunker.main.ChunkerConfigurator)3 IntPair (edu.illinois.cs.cogcomp.core.datastructures.IntPair)3 View (edu.illinois.cs.cogcomp.core.datastructures.textannotation.View)3 StanfordDepHandler (edu.illinois.cs.cogcomp.pipeline.handlers.StanfordDepHandler)3 POSTaggerAnnotator (edu.stanford.nlp.pipeline.POSTaggerAnnotator)3 ParserAnnotator (edu.stanford.nlp.pipeline.ParserAnnotator)3 File (java.io.File)3 ArrayList (java.util.ArrayList)3 EREEventReader (edu.illinois.cs.cogcomp.nlp.corpusreaders.ereReader.EREEventReader)2