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

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

Open
goodmami opened this issue Jun 3, 2020 · 0 comments
Open

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

goodmami opened this issue Jun 3, 2020 · 0 comments
Labels
bug Something isn't working

Comments

@goodmami
Copy link
Collaborator

goodmami commented Jun 3, 2020

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.

@alvations alvations added the bug Something isn't working label Jun 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants