Search in sources :

Example 1 with StemmerOverrideFilter

use of org.apache.lucene.analysis.miscellaneous.StemmerOverrideFilter in project lucene-solr by apache.

the class DutchAnalyzer method createComponents.

/**
   * Returns a (possibly reused) {@link TokenStream} which tokenizes all the 
   * text in the provided {@link Reader}.
   *
   * @return A {@link TokenStream} built from a {@link StandardTokenizer}
   *   filtered with {@link StandardFilter}, {@link LowerCaseFilter}, 
   *   {@link StopFilter}, {@link SetKeywordMarkerFilter} if a stem exclusion set is provided,
   *   {@link StemmerOverrideFilter}, and {@link SnowballFilter}
   */
@Override
protected TokenStreamComponents createComponents(String fieldName) {
    final Tokenizer source = new StandardTokenizer();
    TokenStream result = new StandardFilter(source);
    result = new LowerCaseFilter(result);
    result = new StopFilter(result, stoptable);
    if (!excltable.isEmpty())
        result = new SetKeywordMarkerFilter(result, excltable);
    if (stemdict != null)
        result = new StemmerOverrideFilter(result, stemdict);
    result = new SnowballFilter(result, new org.tartarus.snowball.ext.DutchStemmer());
    return new TokenStreamComponents(source, result);
}
Also used : TokenStream(org.apache.lucene.analysis.TokenStream) StopFilter(org.apache.lucene.analysis.StopFilter) SetKeywordMarkerFilter(org.apache.lucene.analysis.miscellaneous.SetKeywordMarkerFilter) StandardFilter(org.apache.lucene.analysis.standard.StandardFilter) StemmerOverrideFilter(org.apache.lucene.analysis.miscellaneous.StemmerOverrideFilter) StandardTokenizer(org.apache.lucene.analysis.standard.StandardTokenizer) SnowballFilter(org.apache.lucene.analysis.snowball.SnowballFilter) Tokenizer(org.apache.lucene.analysis.Tokenizer) StandardTokenizer(org.apache.lucene.analysis.standard.StandardTokenizer) LowerCaseFilter(org.apache.lucene.analysis.LowerCaseFilter)

Aggregations

LowerCaseFilter (org.apache.lucene.analysis.LowerCaseFilter)1 StopFilter (org.apache.lucene.analysis.StopFilter)1 TokenStream (org.apache.lucene.analysis.TokenStream)1 Tokenizer (org.apache.lucene.analysis.Tokenizer)1 SetKeywordMarkerFilter (org.apache.lucene.analysis.miscellaneous.SetKeywordMarkerFilter)1 StemmerOverrideFilter (org.apache.lucene.analysis.miscellaneous.StemmerOverrideFilter)1 SnowballFilter (org.apache.lucene.analysis.snowball.SnowballFilter)1 StandardFilter (org.apache.lucene.analysis.standard.StandardFilter)1 StandardTokenizer (org.apache.lucene.analysis.standard.StandardTokenizer)1