Skip to content

"Language is not supported." #26

@tezer

Description

@tezer

Hi
I am trying to use Wordnet for Finnish, but it looks like there is no Finnish data downloaded with the package.
This code produces an error below.

from wn import WordNet
from wn.constants import wordnet_30_dir
fin_wn = WordNet(wordnet_30_dir)
print(fin_wn.langs())
fin_wn.synsets(lemma, lang=lang)
4135382db444:python -u /opt/project/task_generation/generator.py
['eng']
Traceback (most recent call last):
  File "/opt/project/task_generation/generator.py", line 18, in <module>
    search_wn('cat', 'n', 'fin')
  File "/opt/project/task_generation/generator.py", line 10, in search_wn
    res = fin_wn.synsets(lemma, lang=lang)
  File "/usr/local/lib/python3.8/site-packages/wn/__init__.py", line 154, in synsets
    self._load_lang_data(lang)
  File "/usr/local/lib/python3.8/site-packages/wn/omw.py", line 79, in _load_lang_data
    raise WordNetError("Language is not supported.")
NameError: name 'WordNetError' is not defined

Do I need to install language-specific packages separately?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions