April 2019
Beginner to intermediate
386 pages
11h 20m
English
Let's go through the following steps:
import opennlp.tools.stemmer.PorterStemmer;
String wordList[] = { "draft", "drafted", "drafting", "drafts", "drafty", "draftsman" };PorterStemmer porterStemmer = new PorterStemmer();for (String word : wordList) { String stem = porterStemmer.stem(word); System.out.println("The stem of " + word + " is " + stem);}
The stem of drafted is draftThe stem of drafting is draftThe stem of drafts is draftThe stem of drafty is draftiThe stem of draftsman is draftsman
Read now
Unlock full access