补充说明:我的系统是win764位,python是2.7.9具体信息显示如下:>>>fromnltk.bookimport****IntroductoryExamplesfortheNLTKBook***Loadingtext1,...,text9andsent1,...,sent9Typeth...
补充说明:我的系统是win7 64位, python是2.7.9
具体信息显示如下:
>>> from nltk.book import *
*** Introductory Examples for the NLTK Book ***
Loading text1, ..., text9 and sent1, ..., sent9
Type the name of the text or sentence to view it.
Type: 'texts()' or 'sents()' to list the materials.
Traceback (most recent call last):
File "", line 1, in
File "D:\Program Files\Python27\lib\site-packages\nltk-3.0.2-py2.7.egg\nltk\bo
ok.py", line 22, in
text1 = Text(gutenberg.words('melville-moby_dick.txt'))
File "D:\Program Files\Python27\lib\site-packages\nltk-3.0.2-py2.7.egg\nltk\te
xt.py", line 295, in __init__
tokens = list(tokens)
File "D:\Program Files\Python27\lib\site-packages\nltk-3.0.2-py2.7.egg\nltk\co
rpus\reader\util.py", line 233, in __len__
for tok in self.iterate_from(self._toknum[-1]): pass
File "D:\Program Files\Python27\lib\site-packages\nltk-3.0.2-py2.7.egg\nltk\co
rpus\reader\util.py", line 282, in iterate_from
self._open()
File "D:\Program Files\Python27\lib\site-packages\nltk-3.0.2-py2.7.egg\nltk\co
rpus\reader\util.py", line 209, in _open
self._stream = self._fileid.open(self._encoding)
File "D:\Program Files\Python27\lib\site-packages\nltk-3.0.2-py2.7.egg\nltk\da
ta.py", line 496, in open
data = self._zipfile.read(self._entry)
File "D:\Program Files\Python27\lib\site-packages\nltk-3.0.2-py2.7.egg\nltk\da
ta.py", line 961, in read
self.close()
File "D:\Program Files\Python27\lib\zipfile.py", line 1386, in close
self._fpclose(fp)
File "D:\Program Files\Python27\lib\zipfile.py", line 1389, in _fpclose
assert self._fileRefCnt > 0
AssertionError
展开