Search in sources :

Example 1 with SynonymAnalyzer

use of com.apple.foundationdb.record.lucene.synonym.SynonymAnalyzer in project fdb-record-layer by FoundationDB.

the class LuceneAnalyzerTest method testSynonymAnalyzer.

@Test
void testSynonymAnalyzer() throws Exception {
    String input = "Hello RL";
    Collection<String> result = new HashSet<>();
    tokenizeWithAnalyzer(result, input, new SynonymAnalyzer(null, EnglishSynonymMapConfig.CONFIG_NAME));
    Assertions.assertEquals(ImmutableSet.of("hi", "how", "hullo", "howdy", "rl", "hello", "do", "you"), result);
}
Also used : SynonymAnalyzer(com.apple.foundationdb.record.lucene.synonym.SynonymAnalyzer) HashSet(java.util.HashSet) Test(org.junit.jupiter.api.Test)

Aggregations

SynonymAnalyzer (com.apple.foundationdb.record.lucene.synonym.SynonymAnalyzer)1 HashSet (java.util.HashSet)1 Test (org.junit.jupiter.api.Test)1