use of org.elasticsearch.plugin.analysis.ukrainian.AnalysisUkrainianPlugin in project elasticsearch by elastic.
the class SimpleUkrainianAnalyzerTests method testAnalyzer.
private static void testAnalyzer(String source, String... expected_terms) throws IOException {
TestAnalysis analysis = createTestAnalysis(new Index("test", "_na_"), Settings.EMPTY, new AnalysisUkrainianPlugin());
Analyzer analyzer = analysis.indexAnalyzers.get("ukrainian").analyzer();
TokenStream ts = analyzer.tokenStream("test", source);
CharTermAttribute term1 = ts.addAttribute(CharTermAttribute.class);
ts.reset();
for (String expected : expected_terms) {
assertThat(ts.incrementToken(), equalTo(true));
assertThat(term1.toString(), equalTo(expected));
}
assertThat(ts.incrementToken(), equalTo(false));
}
use of org.elasticsearch.plugin.analysis.ukrainian.AnalysisUkrainianPlugin in project elasticsearch by elastic.
the class UkrainianAnalysisTests method testDefaultsUkranianAnalysis.
public void testDefaultsUkranianAnalysis() throws IOException {
final TestAnalysis analysis = createTestAnalysis(new Index("test", "_na_"), Settings.EMPTY, new AnalysisUkrainianPlugin());
Analyzer analyzer = analysis.indexAnalyzers.get("ukrainian").analyzer();
MatcherAssert.assertThat(analyzer, instanceOf(UkrainianMorfologikAnalyzer.class));
}
Aggregations