Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Create a graph of a word's synonyms
ResourceFunction["SynonymGraph"]["word"] creates a graphs of synonyms for the given English-language word. | |
ResourceFunction["SynonymGraph"]["word",n] creates a graphs of synonyms for the given word, and recurses down n levels of synonyms. |
These are the synonyms of the word "wood" and which synonyms are synonyms themselves:
| In[1]:= |
| Out[1]= | ![]() |
Go one level deeper:
| In[2]:= |
| Out[2]= | ![]() |
And another level deeper:
| In[3]:= |
| Out[3]= | ![]() |
With the default recurse level, the number of nodes matches the number of synonyms of the word plus one for the original word:
| In[4]:= |
| Out[4]= |
| In[5]:= |
| Out[5]= |
By increasing the recurse level, we get to see additional synonyms not directly related to the original word:
| In[6]:= |
| Out[6]= | ![]() |
All Graph options can be used:
| In[7]:= |
| Out[7]= | ![]() |
CommunityGraphPlot applied to the SynonymGraph of "example" can show an interesting pattern of three communities:
| In[8]:= |
| Out[8]= | ![]() |
This work is licensed under a Creative Commons Attribution 4.0 International License