4
我想導入wordnet
字典,但是當我輸入字典形式wordnet
我看到這個錯誤:導入共發現在NLTK
for l in open(WNSEARCHDIR+'/lexnames').readlines():
IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\WordNet\\2.0\\dict/lexnames'
我安裝wordnet2.1此目錄中,但我不能導入 請幫我解決這個問題
import nltk
from nltk import *
from nltk.corpus import wordnet
from wordnet import Dictionary
print '-----------------------------------------'
print Dictionary.length
感謝您的回答 –
nltk.download('wordnet')'也可以工作=) – alvas
@alvas的版本爲我使用Jupyter notebook,python 3.5工作。 'ntlk.download()'本身無法從筆記本內部打開GUI。如果此命令的幫助在列出用於所有選項的正確字符串方面做得更好,那肯定會很好。 – szeitlin