Porter Stemmer Algorithm is expected to convert source >> sourc. Please read more about porter stemmer algorithm from here
Lucene 4.1.0 Porter Stemmer not work properly
-
30-05-2022 - |
سؤال
I work with my App in Java and i use Lucene 4.1.0 to use Porter Stemmer method. I have read and implementing this
this is my code
import org.apache.lucene.analysis.snowball.*;
import org.tartarus.snowball.ext.PorterStemmer;
private String stemmer(String word){
PorterStemmer obj = new PorterStemmer();
obj.setCurrent(word);
obj.stem();
return obj.getCurrent();
}
this method works, but Porter Stemmer did not work properly for some words e.g :
- source >> sourc
- coupled >> coupl
- accompanying >> accompani
Maybe theres a bug in the algorithm? How to solve this problem?
المحلول
نصائح أخرى
You can use a word suggester on top of porter stemmer. For word suggestion you can use "suggester basic in java"
لا تنتمي إلى StackOverflow