}
@Test
public void longEnglishText() {
try {
Lemmatizer lm = LemmatizerFactory.getPrebuilt("mlteast-en");
String text = "On the other hand, inflectional paradigms, "
+ "or lists of inflected forms of typical words (such as sing, sang, "
+ "sung, sings, singing, singer, singers, song, songs, songstress, "
+ "songstresses in English) need to be analyzed according to criteria "
+ "for uncovering the underlying lexical stem.";
String[] words = text.split("(?=[,.])|\\s+");
for (String word : words) {
if (word.trim().length() > 1) {
CharSequence lemma = lm.lemmatize(word.trim());
if (!word.equals(lemma)) {
System.out.println(word + " -> " + lemma);
}
}
}