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

Find the Most Common Word in the Gettysburg Address

What word occurs most often in the Gettysburg Address?

Run the code to get the text of the Gettysburg Address. Try getting other texts, like AliceInWonderland or ToBeOrNotToBe:

SHOW/HIDE DETAILS

The Wolfram Language has a wealth of built-in examples that are handy for experimenting and testing. This gives a list of the kinds of examples that are available:

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

Give the name of a category to see the examples of that type:

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

Give the specific name to get an example:

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

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

Split the text into individual lowercase words:

Note: run the code in the previous step first.

SHOW/HIDE DETAILS

This splits the Gettysburg Address text into words:

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

Make all of the words lower case so that, for example, The and the both appear as the in the list:

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

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

Find the most common word:

Note: run the code in the previous step first.

SHOW/HIDE DETAILS

Commonest gives the most common element in a list. That is the most common word in the Gettysburg Address:

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

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

Find the most common significant word:

SHOW/HIDE DETAILS

A stopword is a commonly used word like that or the that doesnt reveal much about the content of a text.

Use DeleteStopwords to remove insignificant words from a text:

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

Find the most common significant word:

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

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

Find the three most common significant words. Try other numbers of words:

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