Example #1
0
 @Test
 public void testSimilarity() {
   LexRankRanker summarizer = new LexRankRanker();
   Sentence sentence1 = text.getSentences().get(0);
   Sentence sentence2 = text.getSentences().get(1);
   Map<String, Double> idf = summarizer.inverseDocumentFrequency(text);
   double similarity = summarizer.similarity(sentence1, sentence2, idf);
   Assert.assertEquals(0.2340, similarity, 0.0001);
 }