Try now in the
Open Cloud »
(no sign-in required)

Words Near Your Name

Find words that differ from your name by the fewest characters.

Run this code to get a list of dictionary words:

SHOW/HIDE DETAILS

This returns a list of all the words in the dictionary. The list is automatically shortened because it is very long:

In[1]:=
X
Out[1]=

You can select particular words by giving DictionaryLookup a word pattern.

This gives the list of words that begin with soph:

In[2]:=
X
Out[2]=

HIDE DETAILS
In[1]:=
X
Out[1]=

Compute how many characters have to be edited to get from rhino to rhyno. Try different words:

SHOW/HIDE DETAILS

EditDistance tells you how many characters you have to edit to get from one word to another.

You have to make one edit to change rhino to rhyno (change i to y):

In[1]:=
X
Out[1]=

You have to make two edits to change fish to fin (delete h and change s to n):

In[2]:=
X
Out[2]=

HIDE DETAILS
In[1]:=
X
Out[1]=

Find words that differ by less than three edits from sophia. Try other names:

SHOW/HIDE DETAILS

Select selects items in a list that pass a test.

This selects words whose length is less than 4 characters:

In[1]:=
X
Out[1]=

The test StringLength[#]<4& is whats called a pure function. When its used in Select, each item in turn in the list replaces the hash sign (#), and the function returns True if that items length is less than 4, and otherwise False. Items that return True are selected and those that return False are rejected.

Use Select to select dictionary words whose distance from sophia is less than 3 edits:

In[2]:=
X
Out[2]=

HIDE DETAILS
In[1]:=
X
Out[1]=

Find collections of words that differ by edit distances up to 3 from sophia. Try other names or words:

SHOW/HIDE DETAILS

Table makes lists of things.

This uses Table to make a list of the first three even numbers:

In[1]:=
X
Out[1]=

This makes a list of lists. Each list is the numbers from 1 to n as n goes from 1 to 3:

In[2]:=
X
Out[2]=

This makes a list of lists of words whose edit distances from sophia are n as n goes from 1 to 3:

In[3]:=
X
Out[3]=

HIDE DETAILS
In[1]:=
X
Out[1]=

Format the result as a grid:

SHOW/HIDE DETAILS

Include the edit distance in the list of results:

In[1]:=
X
Out[1]=

Format the result as a grid with edit distances in the first column and words in the second:

In[2]:=
X
Out[2]=

Align the grid columns on the left:

In[3]:=
X
Out[3]=

Add divider lines to make the grid more readable:

In[4]:=
X
Out[4]=

HIDE DETAILS
In[1]:=
X
Out[1]=

Share ItMake a website to find words near your name:

SHOW/HIDE DETAILS

Deploy a form that asks for a name and gives a table of words near it:

In[1]:=
X
Out[1]=

Click the link in the output to visit the site.

Share the link by right-clicking it and choosing Copy Address. Paste the link into an email, tweet, or other message.

HIDE DETAILS
In[1]:=
X
Out[1]=