Like there are built in Stemmers like porter Stemmer in python nltk (https://stackoverflow.com/a/10369407/3096792 ), I want to know if there is any built-in Porter Stemmer in java apache opennlp though there is an interface under this package [opennlp.tools.stemmer.Stemmer]. Since I dont know or need to know the algorithm behind stemming as of now,I need a standard package under apache opennlp toolkit. If not present, whats the alternative in java ?
Asked
Active
Viewed 4,665 times
1 Answers
2
You can use Apache Lucene Snowball Library here
Just put this jar file inside your build path and use it
PorterStemmer stemmer = new PorterStemmer();
stemmer.setCurrent(input); //set string you need to stem
stemmer.stem(); //stem the word
stemmer.getCurrent();//get the stemmed word

Bruce
- 8,609
- 8
- 54
- 83
-
1I downloaded java version from that link, which contains a bunch of java files ( not jar ) , so how can I include them in my build path . Also there is no class called PorterStemmer , I am confused which jar file are you talking about @Exbury – Akash Jan 22 '15 at 16:53
-
sry download Apache lucene http://www.java2s.com/Code/JarDownload/lucene-snowball/lucene-snowball-3.0.2.jar.zip – Bruce Jan 22 '15 at 16:58
-
There is no such class in the provide jar. Please verify and let us know ? – Arjun Prakash Mar 19 '16 at 17:10