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
Support alternative Wordnet versions #2860
Conversation
Hello @ekaf Let me know if that works, and if you need any help. |
Thanks @tomaarsen ! My problem was that I have upgraded to python-3.10, and needed to reinstall all the pip-requirements, |
@ekaf You're right. These test failures are not your fault. |
I've skipped the test. It was too vulnerable to future changes to stopwords for my likings. Beyond that, I've merged develop into your branch for this PR. Hopefully the tests pass now. (Note, tests may also fail due to nltk_data caching, but we'll see) |
Thanks for the inclusion of the doctests! This is ready for merging as far as I'm concerned. I'll have to wait the tests out, and then I'll merge. |
It seems |
It's strange... This test works with python but not with pytest. I have no clue why. |
The failing test would succed when moved to the top of wordnet.doctest. The bug was in get_version, which did not rewind the data.adj file before searching for the version string. |
Wonderful. I hope it wasn't an issue of some other function failing to revert the file position when it should have. I suspect this would have other unexpected consequences. |
Thanks @tomaarsen! I have the same suspicion as you: there is certainly something wrong, because it's not ok that other tests leave data.adj in a dirty state. There must be an issue, and I intend to look into it. |
Happy to hear. Feel free to open an issue or PR when you've made some progress - it's out of the scope of this PR. Perhaps if I have some time myself I'll be able to search for an issue too. |
Solve issue #179 by allowing to load alternative Wordnet versions alongside the current Wordnet 3.0.
Currently, the multilingual OMW functions only work with Wordnet 3.0, so we need to raise a warning when loading other versions. For example, with the proposed new wordnet31 data package (nltk/nltk_data#165):
Issue #2565 is solved in Wordnet 3.1:
nltk v. 3.6.5
Wordnet 3.0: [Synset('confine.v.03'), Synset('control.v.02'), Synset('hold.v.36'), Synset('inhibit.v.04')]
Wordnet 3.1: [Synset('enchain.v.01'), Synset('fetter.v.01'), Synset('ground.v.02'), Synset('impound.v.02'), Synset('pen_up.v.01'), Synset('pinion.v.01'), Synset('pound.v.06'), Synset('tie_down.v.01')]
This PR also supports the forthcoming 2021 release of the Open English Wordnet (https://github.com/globalwordnet/english-wordnet).