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

Fix bug in lemma2synset mapping #9

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

stephantul
Copy link

#8 mentioned that some words return +8000 words when querying for synonyms. This is because some lemmata return None as a value when queried for their synset. These words are then mapped to None in the lemma2synset dictionary, which causes the inverse dictionary synset2lemma to return a whole bunch of garbage lemmata when querying None.

This PR fixes that issue by checking whether the synset_id of a lemma is None before creating a mapping. The mapping dictionaries are also changed from defaultdict to dict, as this can still cause None things to be added to the mapping dictionary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant