Keyboa should suggest Keyboard

RESOLVED FIXED

Status

RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: janjongboom, Assigned: janjongboom)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

From https://bugzilla.mozilla.org/show_bug.cgi?id=1048792#c16

We have a weird case where 'keyboa' doesn't yield any suggestions but 'keybo' and 'keyboar' do. Upping the search limit in worker.js doesn't help either. Need to investigate.
Created attachment 8495206 [details] [diff] [review]
Patch

Alright, so what went wrong was:

- Keyboard is in the candidates list with 2.8 weight
- We have more candidates because we value horizontal aligned keys better now
- All of these candidates have corrections=1 but a higher weight because their freq is high

So we should give a little bump to candidates with corrections 0. I did this based on the frequency (freq/32 * 10), because we don't want to break things like 'kn' which should return 'km' and not 'know'.
Attachment #8495206 - Flags: review?(dflanagan)
(So the queue fills up, is bounded, and bumps keyboard off the list, even though later on it would still be returned as a suggestion, because it's the best match)
Comment on attachment 8495206 [details] [diff] [review]
Patch

I pinged djf last week, but still no review. Can you look at the results this patch produces and see if youre OK with it?
Attachment #8495206 - Flags: review?(dflanagan) → review?(rlu)
Comment on attachment 8495206 [details] [diff] [review]
Patch

This patch looks simple enough for boosting up the weight for this case.
Mind to add more explanation why (freq/32 * 10), seems like magic number to me.

Thanks.
Attachment #8495206 - Flags: review?(rlu) → review+
It is somewhat of a random number. It provides enough boost (4-6) for the words that are relative frequent like keyboard, it doesn't have too much effect (<1) for words that have super low freq. And it didn't break any of my edge cases. It could have been 9 or 11 as well tbh.
Integration tests busted (intermittent?). Restarted them.
Flags: needinfo?(janjongboom)
B2G desktop f3 failed but in re-run it passed. 

Landed https://github.com/mozilla-b2g/gaia/commit/b00737a24cb26b307415b2e2f06a404cf7c23568
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Flags: needinfo?(janjongboom)
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.