Docs2Sentences { public static void main(String[] args) throws Exception { Options options = CliFactory.parseArguments(Options.class, args); CollectionReader reader = UriCollectionReader.getCollectionReaderFromDirectory(options.getInputDirectory()); AggregateBuilder builder = new AggregateBuilder(); builder.add(UriToDocumentTextAnnotator.getDescription()); builder.add(SentenceAnnotator.getDescription()); builder.add(AnalysisEngineFactory.createEngineDescription( LineWriter.class, LineWriter.PARAM_OUTPUT_FILE_NAME, options.getOutputFile(), LineWriter.PARAM_OUTPUT_ANNOTATION_CLASS_NAME, Sentence.class.getName())); SimplePipeline.runPipeline(reader, builder.createAggregateDescription()); System.out.println("results written to " + options.getOutputFile()); }  static void main(String[] args);  }
@Test public void testDocs2Sentences() throws Exception { Docs2Sentences.main(new String[] { "-i", "src/test/resources/data/twain", "-o", "target/test/twain-sentences.txt" }); String[] lines = FileUtil.loadListOfStrings(new File("target/test/twain-sentences.txt")); assertTrue(lines.length > 20); }