This patch fixes a bug in which loading a lemma from the database would clobber any existing entries to the database from a different part of speech but with same lemma. For example, the adjective sense of the word "smart" ("showing mental alterness...") was overwritten by the noun sense ("a kind of pain such as that caused by a wound...") when the data.noun file was loaded on init().
The Database now stores lemmas as a Map<string, Map<string, Index>>, where the outer key is the lemma itself, pointing to a map of POS -> Index. In this way, you can access the requisite POS by calling indexLemmaIndex.get("smart")?.get("adjective");.
This affects the return signatures of searchFor() and searchSimpleFor(), and should be considered a major semver update.
This patch fixes a bug in which loading a lemma from the database would clobber any existing entries to the database from a different part of speech but with same lemma. For example, the adjective sense of the word "smart" ("showing mental alterness...") was overwritten by the noun sense ("a kind of pain such as that caused by a wound...") when the
data.noun
file was loaded oninit()
.The Database now stores lemmas as a
Map<string, Map<string, Index>>
, where the outer key is the lemma itself, pointing to a map ofPOS -> Index
. In this way, you can access the requisite POS by callingindexLemmaIndex.get("smart")?.get("adjective");
.This affects the return signatures of
searchFor()
andsearchSimpleFor()
, and should be considered a major semver update.