Closed Bug 878386 Opened 11 years ago Closed 11 years ago

[keyboard] when no auto corrections are found try harder

Categories

(Firefox OS Graveyard :: Gaia::Keyboard, defect)

x86
macOS
defect
Not set
normal

Tracking

(b2g18 fixed)

RESOLVED FIXED
Tracking Status
b2g18 --- fixed

People

(Reporter: djf, Assigned: djf)

References

Details

Attachments

(1 file)

For speed, the prediction engine does a fairly quick and constrained search for corrections. It has been refactored to be interruptable, however, so when it fails to find any suggestions, we might as well go ahead and ask it to try again, but look harder this time.
Blocks: 797170
No longer blocks: 797170
I'm removing this from the list of bugs blocking bug 797170. I'll create the simple patch described here if, in testing, we find that there are words where the desired suggestion is not coming out correctly.
Assignee: nobody → dflanagan
Attached file link to patch on github (deleted) —
This patch modifies worker.js so that if the first call to predict() doesn't return any suggetions, it tries again, but search for words with edit distance 2 instead of edit distance 1.

There are chagned in predictions.js to make predict() configurable this way.

The results are really good.  We can now make corrections like caebations->carnations and teatinf->testing.  The initial search for caebations takes ~20ms, and the deeper search takes 120ms.  The initial search for teating takes 24ms and the deeper search takes 86ms.  So I think this new strategy of a shallow search followed by a deep search totally wins.

I wish I'd done it a long time ago!
Attachment #758909 - Flags: review?(eshapiro)
Attachment #758909 - Flags: review?(eshapiro) → review+
Landed on master https://github.com/mozilla-b2g/gaia/commit/0225f1ac137f619043054a7b05c998b89fbfaaaf
Blocks: 797170
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Uplifted to v1-train in bug 873934
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: