Non functioning code in chapter 7: sentiwordnet example
ruddjm opened this issue · 1 comments
ruddjm commented
This is also on page 356.
from nltk.corpus import sentiwordnet as swn
good = swn.senti_synsets('good', 'n')[0]
Traceback (most recent call last):
File "", line 1, in
TypeError: 'filter' object is not subscriptable
dipanjanS commented
Python 3 has changed things you can try:
good = list(swn.senti_synsets('good', 'n'))[0]