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 with wildcard #26

Open frituc opened 1 month ago

frituc commented 1 month ago

[Report from an active (former Beolingus) contributor]

For words with many matches it would be useful to have queries like

durchbruch = look up translations for words with durchbruch at the word end bitte pray = look up translations containing the pattern

haukex commented 1 month ago

I began working on this, but discovered a problem: Searching for durchbruch* takes a few milliseconds, but *durchbruch is roughly 200 times slower! I'm currently guessing that this might be because JavaScript regular expressions like /.*durchbruch/i aren't optimized (Perl doesn't have this problem), but I'll have to research this some more before I can continue implementing this.