# Lowercase all the words (to ensure "Sure" and "sure" are matched together)
# Also word_tokenize splits each element in individual tokens
mobyDickText = nltk.word_tokenize(mobyDickText.lower())

# Remove any words that isn't a word
mobyDickText = [word for word in mobyDickText if word[0].isalpha()]

# Using nltk find all the frequencies
mobyDickTextFrequency = nltk.FreqDist(mobyDickText)

# View the top 20 frequencies
mobyDickTextFrequency.tabulate(20)

# Adding stopwords
stopwords = nltk.corpus.stopwords.words("english")

# For every token that is in stopwords, remove it
mobyDictText = [token for token in mobyDictText if token not in stopwords]   

# Using nltk find all the frequencies
mobyDickTextFrequency = nltk.FreqDist(mobyDickText)

# Plot the top 25 frequency words in a graph
modyDickTextFrequency.plot(25, title="Top Frequency Word Tokens in Moby Dick")