Java 类org.apache.lucene.analysis.tokenattributes.KeywordAttribute 实例源码

项目:search    文件:TestBeiderMorseFilter.java   
public void testCustomAttribute() throws IOException {
  TokenStream stream = new MockTokenizer(new StringReader("D'Angelo"), MockTokenizer.KEYWORD, false);
  stream = new PatternKeywordMarkerFilter(stream, Pattern.compile(".*"));
  stream = new BeiderMorseFilter(stream, new PhoneticEngine(NameType.GENERIC, RuleType.EXACT, true));
  KeywordAttribute keyAtt = stream.addAttribute(KeywordAttribute.class);
  stream.reset();
  int i = 0;
  while(stream.incrementToken()) {
    assertTrue(keyAtt.isKeyword());
    i++;
  }
  assertEquals(12, i);
  stream.end();
  stream.close();
}
项目:Maskana-Gestor-de-Conocimiento    文件:TestBeiderMorseFilter.java   
public void testCustomAttribute() throws IOException {
  TokenStream stream = new KeywordTokenizer(new StringReader("D'Angelo"));
  stream = new PatternKeywordMarkerFilter(stream, Pattern.compile(".*"));
  stream = new BeiderMorseFilter(stream, new PhoneticEngine(NameType.GENERIC, RuleType.EXACT, true));
  KeywordAttribute keyAtt = stream.addAttribute(KeywordAttribute.class);
  stream.reset();
  int i = 0;
  while(stream.incrementToken()) {
    assertTrue(keyAtt.isKeyword());
    i++;
  }
  assertEquals(12, i);
  stream.end();
  stream.close();
}
项目:Sefaria-ElasticSearch    文件:HebrewTokenTypeAttributeImpl.java   
@Override
public void reflectWith(AttributeReflector reflector) {
    reflector.reflect(KeywordAttribute.class, "isExact", isExact);
    reflector.reflect(KeywordAttribute.class, "type", type);
}
项目:Sefaria-ElasticSearch    文件:HebrewTokenTypeAttributeImpl.java   
@Override
public void reflectWith(AttributeReflector reflector) {
    reflector.reflect(KeywordAttribute.class, "isExact", isExact);
    reflector.reflect(KeywordAttribute.class, "type", type);
}
项目:Sefaria-ElasticSearch    文件:HebrewTokenTypeAttributeImpl.java   
@Override
public void reflectWith(AttributeReflector reflector) {
    reflector.reflect(KeywordAttribute.class, "isExact", isExact);
    reflector.reflect(KeywordAttribute.class, "type", type);
}