How to get the WordNet synset given an offset ID?

前端 未结 4 2044
天命终不由人
天命终不由人 2020-12-13 10:51

I have a WordNet synset offset (for example id=\"n#05576222\"). Given this offset, how can I get the synset using Python?

4条回答
  •  长情又很酷
    2020-12-13 11:18

    You can use of2ss(), For example:

    from nltk.corpus import wordnet as wn
    syn = wn.of2ss('01580050a')
    

    will return Synset('necessary.a.01')

提交回复
热议问题