0

How can I install AWN on Python, to use Arabic synonyms?

I have AWNDatabaseManagement.py and the file awn.xml, what would my next step be?

I saw this question but I need more details

I found this code and I don't know what is it

from AWNDatabaseManagement import wn

synsets = wn.get_synsetids_from_word(u"جَمِيل")
for s in synsets:
wn._items[s].describe()
Assem
  • 11,574
  • 5
  • 59
  • 97
YayaYaya
  • 125
  • 2
  • 3
  • 10
  • Please, i need help, i want to run this : $ python AWNDatabaseManagement.py -i upc_db.xml but i dont know how :/ – YayaYaya May 25 '16 at 13:16

1 Answers1

0

You should put both files in the same folder than call the command:

$ python AWNDatabaseManagement.py -i upc_db.xml 

You can also change the line 320 in order to import it as a library in python:

opts['i']='E:/usuaris/horacio/arabicWN/AWNdatabase/upc_db.xml'

to

opts['i']='upc_db.xml'

After this you can import it:

from AWNDatabaseManagement import awn

The next commands show how to get synsets of a word and iterate through them.

synsets = awn.get_synsetids_from_word(u"جَمِيل")
for s in synsets:
    wn._items[s].describe()
Assem
  • 11,574
  • 5
  • 59
  • 97
  • I did the first step, and i get this : can't find __main__ module in 'AWNDatabaseManagement.py' , so what should i do ? And i have to change the line 320 ? and i would know the import should be in the (AWNDatabaseManagement.py) ? so i'm little lost. – YayaYaya May 25 '16 at 18:23