nltk/nltk — Issue #35: Chat-80  errors
Author: alexrudnick
Created: 2012-01-17 06:14:00+00:00
State: open

>>> val=nltk.corpus.chat80.make_valuation(concepts,read=True)
/usr/lib/python2.4/site-packages/nltk/corpus/chat80.py:569:
DeprecationWarning:
Function read() has been deprecated. Call the valuation as an
initialization parameter instead
valuation.read(pairs)
;

>>> val['city']['calcutta']
Traceback (most recent call last):
File "<stdin>", line 1, in ?
TypeError: unsubscriptable obje
.

Migrated from http://code.google.com/p/nltk/issues/detail?id=126

earlier comments

ewan.klein said, at 2008-12-18T16:09:50.000Z:

This will work:

>>> val = chat80.make_valuation(concepts, read=True)
>>> 'calcutta' in val['city']
True
>>> [town for (town, country) in val['country_of'] if country == 'india']
['bombay', 'delhi', 'madras', 'hyderabad', 'calcutta']

But make_valuation() needs to be updated to conform to current framework in sem.evaluate