EmbeddingsAnnotatorPipeline { public static void main(String[] args) throws IOException, UIMAException { String inputDir = args.length > 0 ? args[0] : DEFAULT_SOURCE; CollectionReaderDescription reader = createReaderDescription(TextReader.class, TextReader.PARAM_SOURCE_LOCATION, inputDir, TextReader.PARAM_LANGUAGE, LANGUAGE); AnalysisEngineDescription segmenter = createEngineDescription(OpenNlpSegmenter.class); AnalysisEngineDescription stopwordRemover = createEngineDescription(StopWordRemover.class, StopWordRemover.PARAM_MODEL_LOCATION, STOPWORD_FILE); AnalysisEngineDescription embeddingsAnnotator = createEngineDescription( MalletEmbeddingsAnnotator.class, MalletEmbeddingsAnnotator.PARAM_MODEL_LOCATION, EMBEDDINGS_FILE); AnalysisEngineDescription writer = createEngineDescription(CasDumpWriter.class, CasDumpWriter.PARAM_OUTPUT_FILE, OUTPUT_FILE); SimplePipeline.runPipeline(reader, segmenter, stopwordRemover, embeddingsAnnotator, writer); }  static void main(String[] args);  }
@Test public void testMain() throws Exception { EmbeddingsAnnotatorPipeline.OUTPUT_FILE.delete(); String expectedOutput = new String(Files.readAllBytes(EXPECTED_FILE.toPath()), "UTF-8"); EmbeddingsAnnotatorPipeline.main(new String[] {}); String output = new String( Files.readAllBytes(EmbeddingsAnnotatorPipeline.OUTPUT_FILE.toPath()), "UTF-8"); assertEquals(expectedOutput, output); }