Analysis: Add a `kstem` name option to `stemmer` token filter (on top of the default kstem option), closes #1196.
This commit is contained in:
parent
bf9d5a0613
commit
ff2a4ed783
|
@ -25,6 +25,7 @@ import org.apache.lucene.analysis.de.GermanLightStemFilter;
|
||||||
import org.apache.lucene.analysis.de.GermanMinimalStemFilter;
|
import org.apache.lucene.analysis.de.GermanMinimalStemFilter;
|
||||||
import org.apache.lucene.analysis.en.EnglishMinimalStemFilter;
|
import org.apache.lucene.analysis.en.EnglishMinimalStemFilter;
|
||||||
import org.apache.lucene.analysis.en.EnglishPossessiveFilter;
|
import org.apache.lucene.analysis.en.EnglishPossessiveFilter;
|
||||||
|
import org.apache.lucene.analysis.en.KStemFilter;
|
||||||
import org.apache.lucene.analysis.es.SpanishLightStemFilter;
|
import org.apache.lucene.analysis.es.SpanishLightStemFilter;
|
||||||
import org.apache.lucene.analysis.fi.FinnishLightStemFilter;
|
import org.apache.lucene.analysis.fi.FinnishLightStemFilter;
|
||||||
import org.apache.lucene.analysis.fr.FrenchLightStemFilter;
|
import org.apache.lucene.analysis.fr.FrenchLightStemFilter;
|
||||||
|
@ -84,6 +85,8 @@ public class StemmerTokenFilterFactory extends AbstractTokenFilterFactory {
|
||||||
return new SnowballFilter(tokenStream, new ItalianStemmer());
|
return new SnowballFilter(tokenStream, new ItalianStemmer());
|
||||||
} else if ("kp".equalsIgnoreCase(language)) {
|
} else if ("kp".equalsIgnoreCase(language)) {
|
||||||
return new SnowballFilter(tokenStream, new KpStemmer());
|
return new SnowballFilter(tokenStream, new KpStemmer());
|
||||||
|
} else if ("kstem".equalsIgnoreCase(language)) {
|
||||||
|
return new KStemFilter(tokenStream);
|
||||||
} else if ("lovins".equalsIgnoreCase(language)) {
|
} else if ("lovins".equalsIgnoreCase(language)) {
|
||||||
return new SnowballFilter(tokenStream, new LovinsStemmer());
|
return new SnowballFilter(tokenStream, new LovinsStemmer());
|
||||||
} else if ("norwegian".equalsIgnoreCase(language)) {
|
} else if ("norwegian".equalsIgnoreCase(language)) {
|
||||||
|
|
Loading…
Reference in New Issue