Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search with wildcard #26

Open
frituc opened this issue Aug 14, 2024 · 3 comments
Open

Search with wildcard #26

frituc opened this issue Aug 14, 2024 · 3 comments
Labels
enhancement New feature or request wishlist Feature request with somewhat lower priority

Comments

@frituc
Copy link

frituc commented Aug 14, 2024

[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

@frituc frituc added the enhancement New feature or request label Aug 14, 2024
haukex added a commit that referenced this issue Aug 17, 2024
See issue #26

Generated alphabet.json from dict-check.pl,
and refactored equiv.ts a bit.
@haukex
Copy link
Owner

haukex commented Aug 17, 2024

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.

@haukex haukex added the wishlist Feature request with somewhat lower priority label Aug 17, 2024
haukex added a commit that referenced this issue Sep 8, 2024
Mostly moved some code around.

Just to have it noted somewhere: The reason I'm rewriting the search to
use a Web Worker is for issue #15 (short search strings) and issue #26
(wildcard search), both of which take a long time and would otherwise
block the main UI thread.
@haukex
Copy link
Owner

haukex commented Sep 27, 2024

Update: Since I merged the Web Worker branch in 2c3bb38, slow searches are less of a problem because they now show a progress bar instead of blocking the browser.

haukex added a commit that referenced this issue Sep 29, 2024
Began thinking about how to implement wildcards (issue #26).
haukex added a commit that referenced this issue Oct 27, 2024
@haukex
Copy link
Owner

haukex commented Oct 27, 2024

I've released a basic wildcard implementation in d7888d5. I'm still considering what the best way to implement things like "words beginning with X" is, I'm thinking probably regular expressions.

haukex added a commit that referenced this issue Oct 27, 2024
I hope to eventually address issues #25, #26, and #34 with this.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request wishlist Feature request with somewhat lower priority
Projects
None yet
Development

No branches or pull requests

2 participants