AttributeError:'module'对象没有带有nltk.LogicParser()的属性'LogicParser'(AttributeError: 'module' object has no attribute 'LogicParser' with nltk.LogicParser())
我正在玩自然语言处理与Python的例子和这一行:
lp = nltk.LogicParser()产生
AttributeError: 'module' object has no attribute 'LogicParser'错误信息。 我导入了几个nltk模块,我无法弄清楚缺少什么。 有什么线索吗?
I'm playing with examples from Natural Language Processing with Python and this line:
lp = nltk.LogicParser()produces
AttributeError: 'module' object has no attribute 'LogicParser'error message. I imported several nltk modules and I can't figure out what is missing. Any clues?
最满意答案
听起来你已经发现了这个问题,但以防万一:你正在阅读第一版的NLTK书籍,但显然你已经安装了NLTK 3,它有很多变化。 请查看第10章的当前版本以了解正确用法。
It sounds like you've spotted the problem, but just in case: You are reading the first edition of the NLTK book, but evidently you have installed NLTK 3, which has many changes. Look at the current version of chapter 10 for the correct usage.
更多推荐
发布评论