Hello, here i written a code for stemming a word in java.
For it you need a java library, you can download it from here, and load it to you lib folder.
For it you need a java library, you can download it from here, and load it to you lib folder.
Here is the code:
import org.tartarus.snowball.*;
public class EnglishStemmer_porterstemmer {
public static void main(String[] args) throws Exception{
//enter the word in the string.
String a=”phones”;
a=EnglishSnowballStemmerFactory.getInstance().process(a);
System.out.println(a);
}
}
Output: phone
See also:
why EnglishSnowballStemmerFactory. got error?