Skip to content

WordNet.words() has invalid default argument for 'lang' #23

@goodmami

Description

@goodmami

Calling WordNet.words() without an argument raises an error (although not the one expected; see #22):

>>> import wn
>>> w = wn.WordNet()
>>> next(w.words())
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/goodmami/postdoc/wnsd/env/lib/python3.8/site-packages/wn/__init__.py", line 189, in all_lemma_names
    self._load_lang_data(lang)
  File "/home/goodmami/postdoc/wnsd/env/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

The initial problem is that the default value of the lang parameter is 'lang':

def words(self, lang='lang'):

This should probably be 'eng' to be consistent with the other methods.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions