nkprasad12 / morcus-net

Source code for Morcus Latin Tools.
https://morcus.net
GNU General Public License v3.0
6 stars 3 forks source link

Show other search results that differ by only vowel length or capitalization on click #254

Closed nkprasad12 closed 7 months ago

nkprasad12 commented 10 months ago

I want ōs to list

1) ōs 2) ǒs 3) the others.

Meaning that the exact result you selected will be prioritized, but the others will still be visible in case you selected the wrong one.

nkprasad12 commented 10 months ago

The current behavior from the lookup table logic is explained in these unit tests: https://github.com/nkprasad12/morcus-net/blob/6e57b7b39c1b846ef561c24fae25da9d073af6ed/src/common/dictionaries/dict_storage.test.ts#L158C1-L181C6

We can handle this request by removing the diacritics from the search, and then making sure the results are ordered correctly at the end.

In the sql table, we store entries by keys with the diacritics removed already and filter out the ones that don't match, do you just need to revise this filter logic and make sure the results are ranked correctly: https://github.com/nkprasad12/morcus-net/blob/6e57b7b39c1b846ef561c24fae25da9d073af6ed/src/common/dictionaries/dict_storage.ts#L55C1-L65C8