NameAnnotationPipeline { public static void main(String[] args) throws IOException, UIMAException { CollectionReaderDescription reader = createReaderDescription( TextReader.class, TextReader.PARAM_SOURCE_LOCATION, "src/main/resources/namedEntitiesTexts", TextReader.PARAM_PATTERNS, "[+]*.txt", TextReader.PARAM_LANGUAGE, "en"); AnalysisEngineDescription tokenizer = createEngineDescription( BreakIteratorSegmenter.class); AnalysisEngineDescription nameFinder = createEngineDescription( DictionaryAnnotator.class, DictionaryAnnotator.PARAM_MODEL_LOCATION, "src/main/resources/dictionaries/names.txt", DictionaryAnnotator.PARAM_ANNOTATION_TYPE, Name.class); AnalysisEngineDescription writer = createEngineDescription( CasDumpWriter.class, CasDumpWriter.PARAM_TARGET_LOCATION, "target/NameAnnotationPipeline.txt"); SimplePipeline.runPipeline(reader, tokenizer, nameFinder, writer); }  static void main(String[] args);  }
@Test public void test() throws Exception { NameAnnotationPipeline.main(new String[] {}); assertEquals( FileUtils.readFileToString(EXPECTED_OUTPUT, ENCODING).trim(), FileUtils.readFileToString(OUTPUT_FILE, ENCODING).trim()); }