wordnet
wordnet copied to clipboard
WordNet.words() has invalid default argument for 'lang'
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':
https://github.com/nltk/wordnet/blob/4adcbae7f58bcdd0574bd75c4f094b97ddab6d42/wn/init.py#L193
This should probably be 'eng' to be consistent with the other methods.