FrequencyCountPipeline { public static void main(String[] args) throws UIMAException, IOException { CollectionReaderDescription reader = createReaderDescription(TextReader.class, TextReader.PARAM_SOURCE_LOCATION, SOURCE_LOCATION, TextReader.PARAM_LANGUAGE, "en", TextReader.PARAM_LOG_FREQ, 10 ); AnalysisEngineDescription segmenter = createEngineDescription(OpenNlpSegmenter.class); AnalysisEngineDescription freqCounter = createEngineDescription(FrequencyWriter.class, FrequencyWriter.PARAM_TARGET_LOCATION, COUNTS_FILE, FrequencyWriter.PARAM_SORT_BY_COUNT, true, FrequencyWriter.PARAM_MIN_COUNT, MIN_COUNT, FrequencyWriter.PARAM_LOWERCASE, LOWERCASE); runPipeline(reader, segmenter, freqCounter); }  static void main(String[] args);  }
@Test public void testMain() throws Exception { String expectedFirstLine = ",\t3306"; int expectedLines = 8159; final File targetFile = new File(FrequencyCountPipeline.COUNTS_FILE); FrequencyCountPipeline.main(new String[0]); assertTrue(targetFile.exists()); List<String> lines = Files.readAllLines(targetFile.toPath()); assertEquals(expectedFirstLine, lines.get(0)); assertEquals(expectedLines, lines.size()); }