Generate and Verify Stemmed Words
Version 11 includes new tools to find word stems, removing plurals, inflections, etc. The word stem still carries the meaning of the original word, but frequently it will not be a dictionary word itself. This example shows instances of both situations.
Generate a list of 30 random English words with RandomWord.
In[1]:=
Short[words = RandomWord[30]]
Out[1]//Short=
Construct their respective stemmed forms with WordStem.
In[2]:=
Short[wordstems = WordStem[words]]
Out[2]//Short=
Remove the words that are identical to their stemmed forms.
In[3]:=
list = DeleteCases[Transpose[{words, wordstems}], {w_, w_}];
Emphasize in blue the stemmed forms that are also words in the English dictionary used by the new function DictionaryWordQ.
In[4]:=
list = Replace[
list, {w_, sw_?DictionaryWordQ} :> {w, Style[sw, Blue]}, {1}];
Visualize each pair in a text grid.
show complete Wolfram Language input
Out[5]=