コード例 #1
0
 private void verify(List<String> tokens, boolean[] isHashtag) {
   for (int i = 0; i < tokens.size(); i++) {
     assertTrue(stream.incrementToken());
     assertEquals(tokens.get(i), termAttr.getTermString());
     assertEquals(isHashtag[i], TokenType.HASHTAG.equals(typeAttr.getType()));
   }
   assertFalse(stream.incrementToken());
 }
コード例 #2
0
 private void verify(List<String> tokens, TokenType... types) {
   for (int i = 0; i < tokens.size(); i++) {
     assertTrue(stream.incrementToken());
     assertEquals(tokens.get(i), termAttr.getTermString());
     assertEquals(types[i], typeAttr.getType());
   }
   assertFalse(stream.incrementToken());
 }