Arabic Word Net Synonyms In Python?
I am using python 2.7, I am trying to get synonyms of Arabic words using Arabic WordNet I downloaded both needed files: AWNDatabaseManagement.py upc_db.xml Based on this answer
Solution 1:
Arabic Wordnet works independent of nltk. In the folder where you have AWNDatabaseManagement.py
and upc_db.xml
, put your script and change it to:
from AWNDatabaseManagement import wn
synsets = wn.get_synsetids_from_word(u"جَمِيل")
for s in synsets:
wn._items[s].describe()
Output will be:
itemid jamiyl_a1AR
offset 300218842
name جَمِيل
type synset
pos a
input links [[u'be_in_state', u'jamaAl_n1AR'], [u'near_antonym', u'qabiyH_a1AR']]
output links [[u'near_antonym', u'qabiyH_a1AR']]
Post a Comment for "Arabic Word Net Synonyms In Python?"