Reputation:
I'm looking for an efficient way to check if A is a hyponym of B in WordNet using NLTK.
I could use lowest_common_hypernyms
to check if the lowest common hypernym of A and B is B, which means that A is a hyponym of B, but the problem is that B could be a hyponym of A.
Is there any single function that checks this?
Upvotes: 0
Views: 1319
Reputation: 91
motorcar = wn.synset('car.n.01')
types_of_motorcar = motorcar.hyponyms()
types_of_motorcar[26]
Upvotes: 2