aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin
diff options
context:
space:
mode:
authorKeisuke Kuroyanagi <ksk@google.com>2014-12-09 19:23:27 +0900
committerKeisuke Kuroyanagi <ksk@google.com>2014-12-09 19:23:27 +0900
commit515c5081352a6b8feaaf570df7ddb6d3676006e7 (patch)
tree81b0a203cdae555a97c3fb97d75edf241ff3cc9e /java/src/com/android/inputmethod/latin
parentd179e40899b648ce2ceb8543678176f9a696ff30 (diff)
downloadlatinime-515c5081352a6b8feaaf570df7ddb6d3676006e7.tar.gz
latinime-515c5081352a6b8feaaf570df7ddb6d3676006e7.tar.xz
latinime-515c5081352a6b8feaaf570df7ddb6d3676006e7.zip
Quit auto-correct explicit accented letters to base letters.
Bug: 7677193 Change-Id: I66eddbf27a9db8682c0347a1be19922792a3bea7
Diffstat (limited to 'java/src/com/android/inputmethod/latin')
-rw-r--r--java/src/com/android/inputmethod/latin/SuggestedWords.java5
-rw-r--r--java/src/com/android/inputmethod/latin/utils/AutoCorrectionUtils.java4
2 files changed, 9 insertions, 0 deletions
diff --git a/java/src/com/android/inputmethod/latin/SuggestedWords.java b/java/src/com/android/inputmethod/latin/SuggestedWords.java
index 30dd51aed..df8db0cd2 100644
--- a/java/src/com/android/inputmethod/latin/SuggestedWords.java
+++ b/java/src/com/android/inputmethod/latin/SuggestedWords.java
@@ -252,6 +252,7 @@ public class SuggestedWords {
public static final int KIND_FLAG_POSSIBLY_OFFENSIVE = 0x80000000;
public static final int KIND_FLAG_EXACT_MATCH = 0x40000000;
public static final int KIND_FLAG_EXACT_MATCH_WITH_INTENTIONAL_OMISSION = 0x20000000;
+ public static final int KIND_FLAG_APPROPRIATE_FOR_AUTO_CORRECTION = 0x10000000;
public final String mWord;
// The completion info from the application. Null for suggestions that don't come from
@@ -333,6 +334,10 @@ public class SuggestedWords {
return (mKindAndFlags & KIND_FLAG_EXACT_MATCH_WITH_INTENTIONAL_OMISSION) != 0;
}
+ public boolean isAprapreateForAutoCorrection() {
+ return (mKindAndFlags & KIND_FLAG_APPROPRIATE_FOR_AUTO_CORRECTION) != 0;
+ }
+
public void setDebugString(final String str) {
if (null == str) throw new NullPointerException("Debug info is null");
mDebugString = str;
diff --git a/java/src/com/android/inputmethod/latin/utils/AutoCorrectionUtils.java b/java/src/com/android/inputmethod/latin/utils/AutoCorrectionUtils.java
index 2fd257922..c9ecade91 100644
--- a/java/src/com/android/inputmethod/latin/utils/AutoCorrectionUtils.java
+++ b/java/src/com/android/inputmethod/latin/utils/AutoCorrectionUtils.java
@@ -36,6 +36,10 @@ public final class AutoCorrectionUtils {
if (suggestion.isKindOf(SuggestedWordInfo.KIND_WHITELIST)) {
return true;
}
+ // TODO: return suggestion.isAprapreateForAutoCorrection();
+ if (!suggestion.isAprapreateForAutoCorrection()) {
+ return false;
+ }
final int autoCorrectionSuggestionScore = suggestion.mScore;
// TODO: when the normalized score of the first suggestion is nearly equals to
// the normalized score of the second suggestion, behave less aggressive.