Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Create a word graph
ResourceFunction["WordGraph"][dictionary, start, nestlevel] creates a word graph by nesting nestlevel times to find words that have a Hamming distance of 1 from the string or word start based on the data in dictionary. | |
ResourceFunction["WordGraph"][dictionary,start,nestlevel,distancefunction,threshold] creates a word graph by finding words that have a distance of threshold based on the string distance function distancefunction. |
Create a word graph starting from "tears" with WordList by going five levels deep:
In[1]:= |
Out[1]= |
Now go two levels deep and use words that differ by two according to the DamerauLevenshteinDistance:
In[2]:= |
Out[2]= |
Compare the sizes of graphs based on different distance rules:
In[3]:= |
Out[3]= |
This work is licensed under a Creative Commons Attribution 4.0 International License