コード例 #1
0
ファイル: DocumentProcessorTest.java プロジェクト: k9m/k9nlp
 @Test
 public void testEntities() {
   int totalEntities = 0;
   for (Sentence sentence : documentProfile.getSentences()) {
     List<Entity> entities = sentence.getEntities();
     for (Entity entity : entities) {
       final String entityValue = entity.getEntity();
       boolean isInEntities = Arrays.binarySearch(TEST_ENTITIES, entityValue) > -1;
       assertTrue("Not in entities: " + entityValue, isInEntities);
     }
     totalEntities += entities.size();
   }
   assertEquals("Entity mismatch", TEST_ENTITIES.length, totalEntities);
 }
コード例 #2
0
ファイル: DocumentProcessorTest.java プロジェクト: k9m/k9nlp
 @Test
 public void testKeywords() {
   int totalKeywords = 0;
   for (Sentence sentence : documentProfile.getSentences()) {
     List<Keyword> keywords = sentence.getKeywords();
     for (Keyword entity : keywords) {
       final String entityValue = entity.getLemma();
       boolean isInEntities = Arrays.binarySearch(TEST_KEYWORDS, entityValue) > -1;
       assertTrue("Not in entities: " + entityValue, isInEntities);
     }
     totalKeywords += keywords.size();
   }
   assertEquals("Entity mismatch", TEST_KEYWORDS.length, totalKeywords);
 }