aboutsummaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2012-09-20 09:29:31 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2012-09-20 09:29:31 -0700
commit4b45acd27947130510499da9483e9f4706529448 (patch)
treee4520b79db8899a24279480a28910c70222a95c0 /java/src
parenta249101cbef1ca0693fa60129b908d8112a5a548 (diff)
parente3cfa38eef62c31b15a61e58ce29a67204f8082f (diff)
downloadlatinime-4b45acd27947130510499da9483e9f4706529448.tar.gz
latinime-4b45acd27947130510499da9483e9f4706529448.tar.xz
latinime-4b45acd27947130510499da9483e9f4706529448.zip
am e3cfa38e: am 49d080f0: Merge "Auto correct on gesture when typed word is 1 char long" into jb-mr1-dev
* commit 'e3cfa38eef62c31b15a61e58ce29a67204f8082f': Auto correct on gesture when typed word is 1 char long
Diffstat (limited to 'java/src')
-rw-r--r--java/src/com/android/inputmethod/latin/LatinIME.java13
1 files changed, 12 insertions, 1 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index bf64b4f08..9252b0980 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -1401,7 +1401,18 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
Stats.onAutoCorrection("", mWordComposer.getTypedWord(), " ", mWordComposer);
}
}
- commitTyped(LastComposedWord.NOT_A_SEPARATOR);
+ if (mWordComposer.size() <= 1) {
+ // We auto-correct the previous (typed, not gestured) string iff it's one character
+ // long. The reason for this is, even in the middle of gesture typing, you'll still
+ // tap one-letter words and you want them auto-corrected (typically, "i" in English
+ // should become "I"). However for any longer word, we assume that the reason for
+ // tapping probably is that the word you intend to type is not in the dictionary,
+ // so we do not attempt to correct, on the assumption that if that was a dictionary
+ // word, the user would probably have gestured instead.
+ commitCurrentAutoCorrection(LastComposedWord.NOT_A_SEPARATOR);
+ } else {
+ commitTyped(LastComposedWord.NOT_A_SEPARATOR);
+ }
mExpectingUpdateSelection = true;
// The following is necessary for the case where the user typed something but didn't
// manual pick it and didn't input any separator.