Arabic Wordnet for Synonyms in Python? -
i using python 2.7, trying synonyms of arabic words using arabic wordnet
i downloaded both needed files:
awndatabasemanagement.py upc_db.xml
its working fine when enter word not using variable
outputs in backwalter form managed translate them arabic:
but problem want loop on set of words, following error
i'm not familiar package awndatabasemanagement comes from, reading question seems case wm.get_synsetids_from_word() return none when can't find results. (i don't know "synsetids" either.)
to avoid error can this:
synsets = wn.get_synsetids_from_word(xxx) or [] this assign empty list [] synsets in cases function returns none. since empty list iterable, not typeerror when looping on it.
Comments
Post a Comment