aboutsummaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2011-08-31 22:42:11 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-08-31 22:42:11 -0700
commitb17300e2f03d2712bc3aae4a6bf548eb836a27ae (patch)
treee57f7844e2bad60519b3802232aec753bd18866d /java/src
parent537e3d3696aabe9fb1b4fcbf8f08c93c4183ae22 (diff)
parent358e1327d8d1c392ab711778d8e616400360e313 (diff)
downloadlatinime-b17300e2f03d2712bc3aae4a6bf548eb836a27ae.tar.gz
latinime-b17300e2f03d2712bc3aae4a6bf548eb836a27ae.tar.xz
latinime-b17300e2f03d2712bc3aae4a6bf548eb836a27ae.zip
Merge "Fix a bug where autotext would occasionally not work"
Diffstat (limited to 'java/src')
-rw-r--r--java/src/com/android/inputmethod/latin/Suggest.java20
1 files changed, 5 insertions, 15 deletions
diff --git a/java/src/com/android/inputmethod/latin/Suggest.java b/java/src/com/android/inputmethod/latin/Suggest.java
index 29b629576..93933f1bc 100644
--- a/java/src/com/android/inputmethod/latin/Suggest.java
+++ b/java/src/com/android/inputmethod/latin/Suggest.java
@@ -371,24 +371,14 @@ public class Suggest implements Dictionary.WordCallback {
// Apply quick fix only for the typed word.
if (mQuickFixesEnabled) {
final String lowerCaseTypedWord = typedWordString.toLowerCase();
- CharSequence tempAutoText = capitalizeWord(
- mIsAllUpperCase, mIsFirstCharCapitalized, AutoText.get(
- lowerCaseTypedWord, 0, lowerCaseTypedWord.length(), view));
- // TODO: cleanup canAdd
// Is there an AutoText (also known as Quick Fixes) correction?
// Capitalize as needed
- boolean canAdd = tempAutoText != null;
- // Is that correction already the current prediction (or original word)?
- canAdd &= !TextUtils.equals(tempAutoText, typedWord);
- // Is that correction already the next predicted word?
- if (canAdd && mSuggestions.size() > 0 && mCorrectionMode != CORRECTION_BASIC) {
- canAdd &= !TextUtils.equals(tempAutoText, mSuggestions.get(0));
- }
- if (canAdd) {
- if (DBG) {
- Log.d(TAG, "Auto corrected by AUTOTEXT.");
+ autoText = capitalizeWord(mIsAllUpperCase, mIsFirstCharCapitalized, AutoText.get(
+ lowerCaseTypedWord, 0, lowerCaseTypedWord.length(), view));
+ if (DBG) {
+ if (autoText != null) {
+ Log.d(TAG, "Auto corrected by AUTOTEXT: " + typedWord + " -> " + autoText);
}
- autoText = tempAutoText;
}
}
}