1

I already checked all similar thread, but no help.

>>> from nltk import load_parser
>>> parser = load_parser('grammars/book_grammars/drt.fcfg', logic_parser=nltk.sem.drt.DrtParser())
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'DrtParser'

code is given at : http://www.nltk.org/book/ch10.html just above 5.2

>>> print nltk.sem.drt
<module 'nltk.sem.drt' from '/usr/local/lib/python2.7/dist-packages/nltk/sem/drt.pyc'>

what can be the issue?

/nltk/sem has drt.py and drt.pyc files

  • 2
    seems that [`DrtParser` code](https://github.com/nltk/nltk/blame/ad04ad8425328eeaee6c6fa6dad2a9af54d2c416/nltk/sem/drt.py#L50) was added very recently. you may want to check you are using most recent version. – behzad.nouri Sep 15 '14 at 11:37
  • @behzad.nouri: I guess I have most updated one, just recently I have python 2.7.3. do I need to check anything else? –  Sep 15 '14 at 11:40
  • 1
    check `nltk.__version__` – behzad.nouri Sep 15 '14 at 11:47
  • @behzad.nouri: it's '3.0.0b1', any issue with this? –  Sep 15 '14 at 11:50
  • Hmm, 1. `sudo pip install -U nltk` now version is `3.0` and error gone –  Sep 15 '14 at 11:54
  • @behzad.nouri: any help to http://stackoverflow.com/questions/25844794/nltk-was-unable-to-find-mace4 –  Sep 15 '14 at 11:56

0 Answers0