Search in sources :

Example 1 with MorphaAnnotator

use of edu.stanford.nlp.pipeline.MorphaAnnotator in project CoreNLP by stanfordnlp.

the class PatternsSimpleThreadedITest method setUp.

@BeforeClass
public static void setUp() {
    nlpPipeline = new AnnotationPipeline();
    // We assume the input is already tokenized, so we use a cheap whitespace tokenizer.
    // The original code uses this property for the tokenizer:
    // props.setProperty("tokenize.options", "ptb3Escaping=false,normalizeParentheses=false,escapeForwardSlashAsterisk=false");
    nlpPipeline.addAnnotator(new TokenizerAnnotator(false, TokenizerType.Whitespace));
    nlpPipeline.addAnnotator(new WordsToSentencesAnnotator(false));
    nlpPipeline.addAnnotator(new POSTaggerAnnotator());
    nlpPipeline.addAnnotator(new MorphaAnnotator(false));
    Properties nerAnnotatorProperties = new Properties();
    nerAnnotatorProperties.setProperty("ner.useSUTime", Boolean.toString(false));
    nerAnnotatorProperties.setProperty("ner.applyFineGrained", Boolean.toString(false));
    // nerAnnotatorProperties.setProperty("ner.fine.regexner.mapping", spiedProperties.getProperty("fineGrainedRegexnerMapping"));
    try {
        nlpPipeline.addAnnotator(new NERCombinerAnnotator(nerAnnotatorProperties));
    } catch (IOException e) {
        throw new RuntimeIOException(e);
    }
}
Also used : POSTaggerAnnotator(edu.stanford.nlp.pipeline.POSTaggerAnnotator) RuntimeIOException(edu.stanford.nlp.io.RuntimeIOException) MorphaAnnotator(edu.stanford.nlp.pipeline.MorphaAnnotator) NERCombinerAnnotator(edu.stanford.nlp.pipeline.NERCombinerAnnotator) AnnotationPipeline(edu.stanford.nlp.pipeline.AnnotationPipeline) WordsToSentencesAnnotator(edu.stanford.nlp.pipeline.WordsToSentencesAnnotator) RuntimeIOException(edu.stanford.nlp.io.RuntimeIOException) IOException(java.io.IOException) TokenizerAnnotator(edu.stanford.nlp.pipeline.TokenizerAnnotator) Properties(java.util.Properties) BeforeClass(org.junit.BeforeClass)

Aggregations

RuntimeIOException (edu.stanford.nlp.io.RuntimeIOException)1 AnnotationPipeline (edu.stanford.nlp.pipeline.AnnotationPipeline)1 MorphaAnnotator (edu.stanford.nlp.pipeline.MorphaAnnotator)1 NERCombinerAnnotator (edu.stanford.nlp.pipeline.NERCombinerAnnotator)1 POSTaggerAnnotator (edu.stanford.nlp.pipeline.POSTaggerAnnotator)1 TokenizerAnnotator (edu.stanford.nlp.pipeline.TokenizerAnnotator)1 WordsToSentencesAnnotator (edu.stanford.nlp.pipeline.WordsToSentencesAnnotator)1 IOException (java.io.IOException)1 Properties (java.util.Properties)1 BeforeClass (org.junit.BeforeClass)1