rdoeffinger / Dictionary

"QuickDic" offline Dictionary App for Android. Provided downloadable dictionaries are based on Wiktionaries but can also be created from other sources (see DictionaryPC). Remember to use --recursive when cloning! Fork of project that used to be hosted at code.google.com/p/quickdic-dictionary.
Apache License 2.0
313 stars 68 forks source link

Advanced/partial word search #160

Open LaBetonneuse opened 9 months ago

LaBetonneuse commented 9 months ago

Hello,

would it be possible to use wildcards like '?' or '*' for 1 or any number of characters respectively, in the word search? And another character to indicate the beginning or end of a word? ('|' in my examples) => "foob*r" would show "foobar", "foobr" and "foobaaar" => "f*b*r" would show "foobar", "foobr", "foobaaar" and "fbar" => "foob?r" would show "foobar" but neither "foobr" not "foobaaar" => "bar|" would show all words ending with "bar" => "|foo" would show all words beginning with "foo" => "|foobar|" would only show "foobar", not "ffoobar" or "foobarr"

Thanks. 😊

rdoeffinger commented 9 months ago

Well, a lot is possible. But it's not easy. The search is designed to be index based, which means about the same as looking up a paper dictionary, you open a page, check if you landed before or after the word you wanted and then flip back or forward. That method simply does not work with wildcards or any other advanced search expression. So it would need to be a completely new implementation, and it would have far worse performance. So it's not something on my list of things I personally plan to work on.

LaBetonneuse commented 8 months ago

OK, thanks. :)