cltl / OpenDutchWordnet

This repo provides a python module to work with Open Dutch WordNet. It was created using python 3.4.
Other
64 stars 15 forks source link

Fix bug in lemma2synset mapping #9

Open stephantul opened 7 years ago

stephantul commented 7 years ago

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.