LdaEstimationPipeline { public static void main(String[] args) throws IOException, UIMAException { String inputDir = args.length > 0 ? args[0] : DEFAULT_SOURCE_DIR; String coveringType = Sentence.class.getCanonicalName(); 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 lda = createEngineDescription(MalletLdaTopicModelTrainer.class, MalletLdaTopicModelTrainer.PARAM_TARGET_LOCATION, TARGET_FILE, MalletLdaTopicModelTrainer.PARAM_N_ITERATIONS, ITERATIONS, MalletLdaTopicModelTrainer.PARAM_N_TOPICS, N_TOPICS, MalletLdaTopicModelTrainer.PARAM_COVERING_ANNOTATION_TYPE, coveringType); SimplePipeline.runPipeline(reader, segmenter, stopwordRemover, lda); }  static void main(String[] args);  }
@Test public void testMain() throws IOException, UIMAException { LdaEstimationPipeline.TARGET_FILE.delete(); LdaEstimationPipeline.main(new String[] {}); assertTrue("Model not generated.", LdaEstimationPipeline.TARGET_FILE.exists()); try { ParallelTopicModel.read(LdaEstimationPipeline.TARGET_FILE); } catch (Exception e) { System.err.println("Could not read model file:\n" + e.getLocalizedMessage()); throw new AssertionError(e); } }