使用带有python 2.7.3的Wordnet API时出现属性错误

时间:2013-04-25 20:35:44

标签: python-2.7 wordnet corpus

我在python 2.7.3上使用pip install安装了nltk。当我运行这些命令时

import nltk
from nltk.corpus import wordnet as wn
dog = wn.sysnet('dog.n.01')

我收到以下错误..

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python27\lib\site-packages\nltk\corpus\util.py", line 71, in __getattr__
return getattr(self, attr)
AttributeError: 'WordNetCorpusReader' object has no attribute 'sysnet'

我该如何纠正?

1 个答案:

答案 0 :(得分:3)

我认为您需要word.synset,而不是word.sysnet

nltk documentation for synset