Dear All,
When I follow the instruction here
http://www.nltk.org/book/ch01.html to use fdist5 = FreqDist(text5)
IDE interpreter always pops up the following error:
>>> fdist5 = FreqDist(text5)
Traceback (most recent call last):
File "<pyshell#5>", line 1, in <module>
fdist5 = FreqDist(text5)
NameError: name 'FreqDist' is not defined
As a matter of fact, I have input the following commands at the very beginning:
>>> import nltk
>>> from nltk.book import *
Seems the above command are not sufficient.
In order to solve the above Error "name 'FreqDist' is not defined", I have to import it again everytime as follows:
>>> from nltk import FreqDist
Why can't the following two commands work enough to avoid the error?
>>> import nltk
>>> from nltk.book import *
By the way, I am using Python 3.4.2, nltk took kit 3.0.
Any hints? Many thanks.
Sincerely
Typetoken