@Inject public UkrainianIndicesAnalysis(Settings settings, IndicesAnalysisService indicesAnalysisService) { super(settings); final String ANALYZER_KEY = "ukrainian"; final String FILTER_KEY = "ukrainian_lemmatizer"; indicesAnalysisService.analyzerProviderFactories().put( ANALYZER_KEY, new PreBuiltAnalyzerProviderFactory( ANALYZER_KEY, AnalyzerScope.INDICES, new UkrainianAnalyzer(Lucene.VERSION))); indicesAnalysisService.tokenFilterFactories().put( FILTER_KEY, new PreBuiltTokenFilterFactoryFactory(new TokenFilterFactory() { @Override public String name() { return FILTER_KEY; } @Override public TokenStream create(TokenStream tokenStream) { return new MorfologikFilter(tokenStream, UkrainianLemmatizerResources.getDictionary()); } })); }
@Override public TokenStream create(TokenStream tokenStream) { return new MorfologikFilter(tokenStream); }
@Override public TokenStream create(TokenStream tokenStream) { return new MorfologikFilter(tokenStream, UkrainianLemmatizerResources.getDictionary()); }
/** * {@inheritDoc} */ @Override public TokenStream create(TokenStream ts) { return new MorfologikFilter(ts, dictionary, luceneMatchVersion); }