尝试运行
wordnet.synsets('table')
从Windows上的Python 3.6获得
File "<stdin>", line 1, in <module>
File "C:\Users\Leti\Anaconda3\envs\DeepVis\lib\site-packages\nltk\corpus\reader\wordnet.py", line 1424, in synsets
for p in pos
File "C:\Users\Leti\Anaconda3\envs\DeepVis\lib\site-packages\nltk\corpus\reader\wordnet.py", line 1426, in <listcomp>
for offset in index[form].get(p, [])]
File "C:\Users\Leti\Anaconda3\envs\DeepVis\lib\site-packages\nltk\corpus\reader\wordnet.py", line 1280, in _synset_from_pos_and_offset
synset = self._synset_from_pos_and_line(pos, data_file_line)
File "C:\Users\Leti\Anaconda3\envs\DeepVis\lib\site-packages\nltk\corpus\reader\wordnet.py", line 1381, in _synset_from_pos_and_line
raise WordNetError('line %r: %s' % (data_file_line, e))
nltk.corpus.reader.wordnet.WordNetError: line 'tted dalmatian \r\n': not enough values to unpack (expected 2, got 1)
在Linux上可以正常使用!
有人知道发生了什么吗?
nltk_data\corpora\wordnet\data.noun
格式转换为Unix(编辑-> EOL转换-> Unix(LF))