문제

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 :

  1. source >> sourc
  2. coupled >> coupl
  3. accompanying >> accompani

Maybe theres a bug in the algorithm? How to solve this problem?

도움이 되었습니까?

해결책

Porter Stemmer Algorithm is expected to convert source >> sourc. Please read more about porter stemmer algorithm from here

다른 팁

You can use a word suggester on top of porter stemmer. For word suggestion you can use "suggester basic in java"

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top