aboutsummaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
authorKeisuke Kuroyanagi <ksk@google.com>2014-12-09 10:24:55 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-12-09 10:24:56 +0000
commit52e92f812b43fca77f0555965a940faf030bc55b (patch)
tree9427af0e936f6cf8968be77c3500ebe60cff02a7 /java/src
parentbe819dbe2b7a5c418530a2fa1182766a4d31d6d5 (diff)
parent515c5081352a6b8feaaf570df7ddb6d3676006e7 (diff)
downloadlatinime-52e92f812b43fca77f0555965a940faf030bc55b.tar.gz
latinime-52e92f812b43fca77f0555965a940faf030bc55b.tar.xz
latinime-52e92f812b43fca77f0555965a940faf030bc55b.zip
Merge "Quit auto-correct explicit accented letters to base letters."
Diffstat (limited to 'java/src')
-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.