You do not need an additional library, but you need a dictionary. You can download it from Princeton: https://wordnet.princeton.edu/wordnet/download/current-version/
I recommend downloading only the dictionary from the section "Only for DATABASE WordNet 3.1 files" Extract archive. Assuming PATH / dict is the output location, you can use this code:
Dictionary dict = new Dictionary(new File("PATH/dict")); dict.open(); WordnetStemmer stemmer = new WordnetStemmer(dict); List<String> test = stemmer.findStems("feet", POS.NOUN); for (int i = 0; i < test.size(); i++) { System.out.println(test.get(i)); }
The output for this example is "foot."
nelly source share