1
Ich versuche, diesen Block von Codes im Terminal mit Python zu laufen:Typeerror: Objekt vom Typ 'instancemethod' hat keine len() in NLTK
>>> from nltk.corpus import wordnet
>>> syn = wordnet.synsets('cookbook')[0]
>>> lemmas = syn.lemmas
>>> len(lemmas)
Und ein Fehler stellte sich heraus:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: object of type 'instancemethod' has no len()
Was ist falsch und wie behebt man das?
gleiche Problem wie http://stackoverflow.com/questions/36234498/typeerror-instancemethod-object-has-no-attribute-getitem-with-nltk ; P Das gedruckte NLTK-Buch ist ziemlich veraltet, folgen Sie der elektronischen Version: http://www.nltk.org/book/. Ich finde die Howtos-Seite nützlich für Referenzen: http://www.nltk.org/howto/ – alvas
@alvas Wow, das ist super, vielen Dank! – Kathryn