[ReaderDictionary] match words when they are Capitalised#13884
Conversation
|
@poire-z this is 4 lines long, 50% of which are filler ;) say something |
|
Not competent enough to say if it's a good idea or not. |
Indeed. The problem (if it is one) is that there's full fuzzy or nothing but not something in between like "ignore capitalization and diacritics". In this form it seems to somewhat sabotage the preferences of people who are against fuzzy search. |
|
I agree with Frenzie here; it does seem to go a bit against the principle of exact search. Btw, I did a quick test of the dictionary preset PR (#13774) and the 'One-time search with preset' feature is pretty cool. And to access the presets from the highlight dialog, I would suggest that long-pressing Dictionary opens a dialog to select the list of dictionary presets for a one-time search. |
|
Let's try to get some context around here, with the help of my friend Claude: now our target is the last two bullets there, proper nouns is what Frenzie calls "sabotage the preferences of people who are against fuzzy search". I for one, have become very adamant of not using fuzzy searches as, and please forgive me here, I find it to not be fussy enough (I mean that in the sense of not being selective enough, "picky"). But back to the matter at hand.
I agree with this, however,
I like to think of it as course correction, it's not really an interference, only making sure 5-8K potential capitalised words get a valid response. Also, we are not really increasing the search by 100%, sure we do if the word is capitalised but the majority of searches will continue to be of normal lower case words, as that makes up about 90% of a text, so although correct, in practise it will only add a bit of time in every 1 out 10 queries.
what? how could they be equal? genuinely asking, I mean we are checking for capital letters
only it doesn't, or it does but only for those 3-5K proper nouns, but you still get the exact match though (if it exists), you just happen to get another one on top.
I was trying to avoid adding another menu entry, I still believe this is a cleaner approach but if that is a preferred solution, I wouldn't be against it. The diacritic though, I don't know about that part, it think that might be best left to a smart, intelligent frenchman.
well, you need to become competent then, as it's your reader dictionary. ;) |
Oh, right :) (It wasn't as explicite as my brain state needed, but you are right.)
It's not mine - and I'm so used to fuzzy search, so I have no idea how non-fuzzy people work :) |
|
Well you’re the gatekeeper ;) |
Frenzie
left a comment
There was a problem hiding this comment.
Anyway, fine by me I suppose.
|
The problem with word:lower() is that uppercase letters not available in the ASCII set (Ñ, for example) won't be converted. Ñapa won't be converted to ñapa. That's why I used Utf8Proc.lowercase(word) in the patch I posted here |
|
that is a valid point I hadn't consider. |
|
Sidenote 'cause I had to leave home but yhe isUppercase function in that patch has the same issue. %l is just a-z Edit: |
|
in the spirit of user patching, could I do something like this? if not self.removed_by_patch and index == 1 thenkoreader/frontend/ui/widget/dictquicklookup.lua Lines 1161 to 1168 in 6133a43 |
|
That's probably better if you extract the entire thing into a method? |
what's new
This pull request introduces a small enhancement to the
ReaderDictionarymodule. The change improves the handling of word lookups by adding a lowercase version of a word to the search array if the word starts with a capital letter and fuzzy search is disabled.why?
it does seem quite silly, that a user might not get any results due to punctuation, in the following example all "Count", "Back", "Your", "Wait", "Have", "Tonight", "Tomorrow" and "There" yield no results at all, event though the dictionary has entries for them (in lowercase)
related issues
This change is