Hi Stackoverflow Community
I just started tinkering around with Python NLTK and have directed my attention to the Wordnet module.
I am attempting to get the Sense Ky for a given lemma and found the following:
s = wn.synset('skill.n.01')
s.lemmas # >>> [Lemma('skill.n.01.skill'), ... ]
s.lemmas[0].key # >>> 'skill%1:09:01::'
However, this implementation doesn't seem to be supported anymore.
Traceback (most recent call last):
File "C:/Users/Admin/PycharmProjects/momely/placementarchitect/testbench.py", line 59, in <module>
s.lemmas[0].key
TypeError: 'method' object is not subscriptable
I am wondering whether anyone would be able to point me in the right direction as to how I might be able to get the sense key given a lemma or synset?
Any advice would be highly appreciated!
Take a look at https://stackoverflow.com/a/27518899/610569 for the difference between,
Synset.lemmas()[0].keyandSynset.lemmas()[0].key():For Open Multilingual WordNet, using the offset + pos keys would be easier, e.g.:
Searching the offset + pos key (e.g.
02084071-n) on the OMW interface: http://compling.hss.ntu.edu.sg/omw/cgi-bin/wn-gridx.cgi?gridmode=grid will get you to a nice visualization page of the synset.