Get synonyms from synset returns error - Python

后端 未结 2 1730
执笔经年
执笔经年 2021-02-11 03:19

I\'m trying to get synonyms of a given word using Wordnet. The problem is that despite I\'m doing the same as is written here: here, it returns error.

Here is my code:<

2条回答
  •  青春惊慌失措
    2021-02-11 04:10

    In Python 2 & 3 versions lemmas and lemma_names don't work as they are methods. You have to use lemmas() and lemma_names() instead.

    For eg -

    dog = wn.synset('dog.n.01') print dog.lemma_names()

提交回复
热议问题