itkach / aard2-android

Aard2 for Android, a simple dictionary app
GNU General Public License v3.0
426 stars 98 forks source link

Support "contains / substring" search #112

Closed ilius closed 3 years ago

ilius commented 3 years ago

I'm the author of PyGlossary that's using slob library to create slob files.

Looks like both web and Android apps only search with "startsWith" or prefix query. I can't find a way to enable substring string (contains query).

Is this something that can be fixed in the slob glossary?

Not sure if it's related, but the fragment is empty in my conversion code. I tried passing the second word of the key, but results still not showing up when I search the second word.

itkach commented 3 years ago

Looks like both web and Android apps only search with "startsWith" or prefix query.

Yes.

I can't find a way to enable substring string (contains query).

The only way to achieve this is to build a dictionary with all the substrings for each word added to the lookup index, but then lookup results would be too noisy and unintutive to be useful

Not sure if it's related, but the fragment is empty in my conversion code.

This is not related. "Fragment" has the same meaning as in URLs - it identifies a location within content

ilius commented 3 years ago

Thanks for responding.

sobaee commented 3 years ago

I think searching with the 2nd word can be managed with aard2 app itself not with slob glossary. No need to make a slob file with substrings contained inside of it, just modify the lookup way of aard2 app to lookup in the 2nd word, not just the first word.

sobaee commented 3 years ago

This characteristic is called fuzzy search Many apps supports it It searches in all keywords with any word you type in search box

ildar commented 3 years ago

+1 for fuzzy search. BTW I already requested it: https://github.com/itkach/aard2-android/issues/25