@Test public void TestDefaults() throws Exception { String testDocument = "This is a not so long test sentence. This is a longer second test sentence. More sentences are necessary for the tests."; AnalysisEngineDescription aggregate = createEngineDescription( createEngineDescription(BreakIteratorSegmenter.class), AnalysisEngineFactory.createEngineDescription(StanfordPosTagger.class, StanfordPosTagger.PARAM_LANGUAGE, "en"), AnalysisEngineFactory.createEngineDescription(StanfordLemmatizer.class), createEngineDescription( PosFilter.class, PosFilter.PARAM_TYPE_TO_REMOVE, Token.class.getName() ), CooccurrenceGraphFactory.getCooccurrenceGraph_token(), createEngineDescription( PageRankRanking.class ) ); AnalysisEngine engine = AnalysisEngineFactory.createEngine(aggregate); JCas aJCas = engine.newJCas(); aJCas.setDocumentText(testDocument); engine.process(aJCas); int i=0; for (Keyphrase keyphrase : JCasUtil.select(aJCas, Keyphrase.class)) { System.out.println("\"" + keyphrase.getKeyphrase() + "\", " + keyphrase.getScore()); i++; } assertEquals(0,i); }
@Override public void process(JCas jcas) throws AnalysisEngineProcessException { getContext().getLogger().log(Level.CONFIG, "Entering " + this.getClass().getSimpleName()); pageRank.initializeFromAnnotationPairIterator( JCasUtil.select(jcas, AnnotationPair.class), weighted ); pageRank.run(); List<TermRank> termRanks = pageRank.getTermRanks(); getContext().getLogger().log(Level.FINE, termRanks.toString()); for (TermRank termRank : termRanks) { addKeyphrase(jcas, termRank); } }
PageRankRanking extends JCasAnnotator_ImplBase { @Override public void process(JCas jcas) throws AnalysisEngineProcessException { getContext().getLogger().log(Level.CONFIG, "Entering " + this.getClass().getSimpleName()); pageRank.initializeFromAnnotationPairIterator( JCasUtil.select(jcas, AnnotationPair.class), weighted ); pageRank.run(); List<TermRank> termRanks = pageRank.getTermRanks(); getContext().getLogger().log(Level.FINE, termRanks.toString()); for (TermRank termRank : termRanks) { addKeyphrase(jcas, termRank); } } }
PageRankRanking extends JCasAnnotator_ImplBase { @Override public void process(JCas jcas) throws AnalysisEngineProcessException { getContext().getLogger().log(Level.CONFIG, "Entering " + this.getClass().getSimpleName()); pageRank.initializeFromAnnotationPairIterator( JCasUtil.select(jcas, AnnotationPair.class), weighted ); pageRank.run(); List<TermRank> termRanks = pageRank.getTermRanks(); getContext().getLogger().log(Level.FINE, termRanks.toString()); for (TermRank termRank : termRanks) { addKeyphrase(jcas, termRank); } }  }
PageRankRanking extends JCasAnnotator_ImplBase { @Override public void process(JCas jcas) throws AnalysisEngineProcessException { getContext().getLogger().log(Level.CONFIG, "Entering " + this.getClass().getSimpleName()); pageRank.initializeFromAnnotationPairIterator( JCasUtil.select(jcas, AnnotationPair.class), weighted ); pageRank.run(); List<TermRank> termRanks = pageRank.getTermRanks(); getContext().getLogger().log(Level.FINE, termRanks.toString()); for (TermRank termRank : termRanks) { addKeyphrase(jcas, termRank); } }  @Override void initialize(UimaContext context); @Override void process(JCas jcas); }
PageRankRanking extends JCasAnnotator_ImplBase { @Override public void process(JCas jcas) throws AnalysisEngineProcessException { getContext().getLogger().log(Level.CONFIG, "Entering " + this.getClass().getSimpleName()); pageRank.initializeFromAnnotationPairIterator( JCasUtil.select(jcas, AnnotationPair.class), weighted ); pageRank.run(); List<TermRank> termRanks = pageRank.getTermRanks(); getContext().getLogger().log(Level.FINE, termRanks.toString()); for (TermRank termRank : termRanks) { addKeyphrase(jcas, termRank); } }  @Override void initialize(UimaContext context); @Override void process(JCas jcas); static final String PARAM_WEIGHTED; }