lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sirish Vadala <>
Subject KStemFilter
Date Fri, 14 Jun 2013 17:30:42 GMT
Hello All,

I have a new requirement within my text search implementation to perform
stemming. I have done some research and implemented snowball, but however
the customers found it too aggressive and eventually I got them to agree to
compromise on k-stem algorithm.

Currently my existing code is on Lucene 2.9, which I would like to push to
the latest Lucene 4.3. So finally I have decided to build a custom analyzer
that implements kstem filter.

/    public class KStemAnalyzer extends Analyzer {

          public final TokenStream tokenStream(String fieldName, Reader
reader) {
               TokenStream result = new StandardTokenizer(Version.LUCENE_43,
               result = new StandardFilter(Version.LUCENE_43, result);
               result = new LowerCaseFilter(Version.LUCENE_43, result);
               result = new StopFilter(Version.LUCENE_43, result,
               return new KStemFilter(result);

          protected TokenStreamComponents createComponents(String string,
Reader reader) {
              throw new UnsupportedOperationException("Not supported yet.");

However I get an error /'tokenStream(String,Reader) in KStemAnalyzer cannot
override tokenStream(String,Reader) in Analyzer overridden method is
final'/. I was looking to find some documentation or example
implementations, but all I could find is the api that is not very

Any hint on how to initialize this would be highly appreciated.


View this message in context:
Sent from the Lucene - Java Users mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message