Autocorrect #9052

merged 1 commit into from Apr 11, 2013


None yet
2 participants

Still a work in progress. Needs tweaking before merging. Still needs a settings UI, too.

+ // with them here.
+ function handleSuggestions(input, suggestions) {
+ if (suggestions.length === 0) { // If no suggestions
+ keyboard.sendCandidates(suggestions); // Clear any displayed suggestions

gregorwagner Apr 11, 2013


Why do you add the suggestions here?


davidflanagan Apr 11, 2013

Suggestions is an empty array here, so I'm just using it to clear any previously displayed suggestions.

+ function autoPunctuate(keycode) {
+ switch (keycode) {
+ case SPACE:
+ if ( - lastKeyWasSpace < DOUBLE_SPACE_TIME)

gregorwagner Apr 11, 2013


lastKeyWasSpace sounds more like a bool to me.

I've pushed a new version of the patch that fixes the bug where an old auto correction (jrego -> regolith) could still happen even after the suggestions disappeared.

I've also updated the tests so that (hopefully) the Travis build will not fail anymore. (I had changed an internal API that the tests used and hadn't updated them accordingly).

Updated the patch again to change the lastKeyWasSpace variable to lastSpaceTimestamp

I don't know what caused the travis failure: none of the tests ran for some reason. But there is no lint.

davidflanagan pushed a commit that referenced this pull request Apr 11, 2013

Merge pull request #9052 from davidflanagan/autocorrect
Bug 860462 - enable keyboard auto-correction r=gwagner

@davidflanagan davidflanagan merged commit 132c5a7 into mozilla-b2g:master Apr 11, 2013

1 check failed

default The Travis build failed

davidflanagan pushed a commit to davidflanagan/gaia that referenced this pull request Jun 6, 2013

Bug 873934: uplift auto-correct patches from master to v1-train
Revert "Merge pull request #9971 from es92/bug-851565-keyboard-suggestion-capitalization-fix"

This reverts commit 37d7a21, reversing
changes made to eea3449.

Revert "Merge pull request #9183 from evelynhung/issue-861108-v1.0.1"

This reverts commit 21ff040.

Merge pull request #9052 from davidflanagan/autocorrect

Bug 860462 - enable keyboard auto-correction r=gwagner(cherry picked from commit 132c5a7)



Merge pull request #9124 from ckerschb/docu2

Bug 858158 (final) - [keyboard] document prediction algorithm and make it tuneable(cherry picked from commit d83b558)

Merge pull request #9421 from davidflanagan/bug797171

Bug 797171: revert user-selected suggested words on backspace r=anygregor(cherry picked from commit 23ed330)

Merge pull request #9422 from davidflanagan/bug861113

Bug 861113: correctly define uppercase for non Latin-1 letters(cherry picked from commit 58665c2)

Merge pull request #9153 from davidflanagan/bug860624

Bug 865484 - refactor dictionary data structure and search algorithm for keyboard auto-correct r=anygregor r=ckerschb
(cherry picked from commit 413482d)

Merge pull request #9610 from davidflanagan/autocorrect-visuals

Bug 868819: modify auto-correct UX and visuals(cherry picked from commit 9fa85e6)



Merge pull request #10038 from comoyo/keyboard_no_autocorrect

Bug 876658 - Dont perform autocorrect if old & new word are the same. r=rudyl(cherry picked from commit bebcb40)

Merge pull request #10155 from davidflanagan/bug876891

Bugs 878387, 878168, 876891: fix three closely related auto-correct bugs. r=janjongboom(cherry picked from commit 6ca1a9b)

Merge pull request #10154 from davidflanagan/bug873223

Bug 873223: make long suggestions fit, increase font size, fix justification r=RudyLu(cherry picked from commit 417e5e2)



Merge pull request #10171 from davidflanagan/bug878384

Bug 878384: don't autocorrect single-letters r=es92(cherry picked from commit 7611662)

Merge pull request #10172 from davidflanagan/bug878838

Bug 878838: don't suggest the same word twice r=es92(cherry picked from commit 0689050)

Merge pull request #10173 from davidflanagan/nondeterministic-autocorrect

Bug 879076: handle case of nearby keys correctly r=es92(cherry picked from commit 60d03c4)

Merge pull request #10175 from davidflanagan/bug878843

Bug 878843 - Integrate with replaceSurroundingText for autocorrect (with... r=fabrice,djf(cherry picked from commit bc48562)

tweak css for suggestions display because of keyboard layout differences between master and v1-train

Merge pull request #10228 from es92/Bug879187

Bug879187: Autocorrect suggestions disappear when keyboard redrawn r=davidflanagan(cherry picked from commit 159b0dd)

Merge pull request #10227 from davidflanagan/bug879533

Bug 879533: don't display user's input if we don't have any suggestions r=es92(cherry picked from commit eed0873)

Merge pull request #10230 from davidflanagan/bug878386

Bug 878386: if initial search for corrections fails, search harder r=es92(cherry picked from commit 0225f1a)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment