haukex / de-en-dict

German-English Dictionary
https://dict.zero-g.net/
GNU General Public License v2.0
10 stars 1 forks source link

Search for words with apostrophe #11

Closed frituc closed 1 month ago

frituc commented 1 month ago

The de-en.txt contains ’ (U+2019 RIGHT SINGLE QUOTATION MARK) for apostrophe like in can’t (well, almost). User often type ' (U+0027): can't – nothing is found. So substitute ' for ’ before searching will help.

There might be other useful substitutions, I’ll report here.

Thanks Frank

haukex commented 1 month ago

Thanks very much for the suggestion, I've implemented this in 55044b7bfaf3653d4377a861d61242802687c304, with the addition that searching for double quotes matches any kind of double quotes, and searching for ae/oe/ue matches ä/ö/ü, and ss/sz matches ß, so searching for "Veraenderung" matches "Veränderung" and "Verschleiss" results in "Verschleiß".

I have left this issue open because I have two more questions:

haukex commented 1 month ago
frituc commented 1 month ago
  • Should searching for "Göthe" (currently no results) result in the match "Goethe"?
  • Should searching for "Veranderung" (currently no results) result in the match "Veränderung"? A lot of search functions implement this kind of searching. (similarly, the search currently differentiates between "café" and "cafe")

With user expectations from major search engines in mind: Yes, we should try this. If it produces too many false positives – or delay the search significantly – we should rethink it.

haukex commented 1 month ago

Implementation here: https://github.com/haukex/de-en-dict/blob/main/src/js/equiv.ts