using all_synsets function in open multilingual wordnet

90 views
Skip to first unread message

ali alk

unread,
May 4, 2017, 5:01:29 AM5/4/17
to nltk-users
Hello

Is it possible to go through all synsets using the function all_synsets in OMW, if yes HOW?

Thank you

Hosein Rezaei

unread,
Feb 4, 2018, 4:02:46 AM2/4/18
to nltk-users
I need something like all_synsets(lang='fas')

Dimitriadis, A. (Alexis)

unread,
Feb 4, 2018, 4:38:55 AM2/4/18
to <nltk-users@googlegroups.com>
In wordnet, a "synset" represents a meaning, and is in principle language-independent. All synsets have English-based names, but are linked to lemmas in multiple languages. You can get a list of all *lemmas* for a particular language, e.g. Farsi, with wn.words(lang="fas")

Depending on what you are after, you could collect all synsets for which there is at least one Farsi lemma like this:

all_farsi_synsets = set(s for lemma in wn.words(lang="fas") for s in wn.synsets(lemma, lang="fas"))

As a side-note, it seems that there are some problems (i.e., bugs) with the mapping: Some of the synsets you will find in this way do not link back to a Farsi lemma. 

Best,

Alexis


Dr. Alexis Dimitriadis | Assistant Professor and Senior Research Fellow | Utrecht Institute of Linguistics OTS | Utrecht University | Trans 10, 3512 JK Utrecht, room 2.33 | +31 30 253 65 68 | a.dimi...@uu.nl | www.hum.uu.nl/medewerkers/a.dimitriadis

--
You received this message because you are subscribed to the Google Groups "nltk-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nltk-users+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages