Skip to content

SQLiteWordNet Tutorial

Le Tuan Anh edited this page Nov 22, 2016 · 1 revision

Preparation

import yawlib
from yawlib import YLConfig
from yawlib import WordNetSQL
wn = WordNetSQL(YLConfig.WORDNET_30_PATH)

Accessing information

ss = wn.get_all_synsets()

# search by lemma
catss = wn.search_senses('cat')

# search by synsetid
dcat = wn.get_senseinfo_by_sid('102121620')

# get definition
print(dcat.definition)
Clone this wiki locally