2016-12-15 25 views

回答

0

的功能還有就是上位爲同義詞集()方法。另外,可以使用lowest_common_hypernyms()。請記住,synsets可以包含多個單詞。可以在下面找到用於導航wordnet的一些示例代碼。

from nltk.corpus import wordnet as wn 
right_whale = wn.synset('right_whale.n.01') 
orca = wn.synset('orca.n.01') 
print orca 
print right_whale.lowest_common_hypernyms(orca) 
baleen_whale = right_whale.hypernyms()[0] 
print baleen_whale 
相關問題