Object "inc" with NLTK for py 2.7
I just downloaded nltk this morning and already faced the problem of repeating my code.
I get
AttributeError: 'FreqDist' object has no attribute 'inc'
I had the same error with this code,
for word in gutenberg.words(βausten-persuasion.txtβ):
fd.inc(word)
but just changed it to
fd[word] += 1
However, where can I go when I come across the code below?
for word in gutenberg.words(u'austen-persuasion.txt'):
cfd[prev_word].inc(word)
prev_word = word
+3
source to share