Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Load wordnet without OMW #3026

Merged
merged 2 commits into from
Jul 29, 2022
Merged

Load wordnet without OMW #3026

merged 2 commits into from
Jul 29, 2022

Conversation

ekaf
Copy link
Contributor

@ekaf ekaf commented Jul 22, 2022

Fix #3024: allow wordnet to load without requiring OMW.

from nltk.corpus import wordnet as wn
ss_list = wn.synsets('test')
print(ss_list)

[Synset('trial.n.02'), Synset('test.n.02'), Synset('examination.n.02'), Synset('test.n.04'), Synset('test.n.05'), Synset('test.n.06'), Synset('test.v.01'), Synset('screen.v.01'), Synset('quiz.v.01'), Synset('test.v.04'), Synset('test.v.05'), Synset('test.v.06'), Synset('test.v.07')]

print(wn.langs())

['eng']

spanish = [ss.lemmas(lang='spa') for ss in ss_list]
print(spanish)

[[Lemma('trial.n.02.prueba')], [Lemma('test.n.02.test')], [Lemma('examination.n.02.examen'), Lemma('examination.n.02.test')], [Lemma('test.n.04.examen'), Lemma('test.n.04.prueba'), Lemma('test.n.04.test')], [Lemma('test.n.05.ensayo'), Lemma('test.n.05.prueba')], [], [Lemma('test.v.01.ensayar'), Lemma('test.v.01.examinar'), Lemma('test.v.01.probar')], [], [], [], [], [], []]

print(wn.langs())

['eng', 'als', 'arb', 'bul', 'cmn', 'dan', 'ell', 'fin', 'fra', 'heb', 'hrv', 'isl', 'ita', 'ita_iwn', 'jpn', 'cat', 'eus', 'glg', 'spa', 'ind', 'zsm', 'nld', 'nno', 'nob', 'pol', 'por', 'ron', 'lit', 'slk', 'slv', 'swe', 'tha']

@stevenbird stevenbird merged commit 3b72fa2 into nltk:develop Jul 29, 2022
@stevenbird
Copy link
Member

Thanks @ekaf!

@ekaf ekaf deleted the hotfix_3024 branch September 4, 2022 06:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

nltk 3.7 requires explicit download of omw-1.4 on Linux
2 participants