I am a beginner in Python and NLTK. I am trying to run the following code from a tutorial:
from nltk.corpus import gutenberg
from nltk import FreqDist
fd =
Latest version of nltk doesn't have inc. Rather I used update.
from nltk.corpus import gutenberg
from nltk import FreqDist
fd = FreqDist()
for word in gutenberg.words('austen-sense.txt'):
fd.update([word])
The update takes iterable item. So make sure you are passing iterable item in update function.