diff options
author | 2012-09-18 12:07:33 +0900 | |
---|---|---|
committer | 2012-09-18 12:07:33 +0900 | |
commit | f18fc03621b70f5a51cf54c4bf40eb213de40652 (patch) | |
tree | e6897145da33c21866b57c95444a530488ca2af1 /java/src/com/android/inputmethod/latin/Suggest.java | |
parent | 9761fa578609b4f3788344b5b3c886b1e883e97e (diff) | |
parent | 764dd712032d7b8012797b1116b523bef7b907f3 (diff) | |
download | latinime-f18fc03621b70f5a51cf54c4bf40eb213de40652.tar.gz latinime-f18fc03621b70f5a51cf54c4bf40eb213de40652.tar.xz latinime-f18fc03621b70f5a51cf54c4bf40eb213de40652.zip |
Merge remote-tracking branch 'goog/jb-mr1-dev' into mergescriptpackage
Diffstat (limited to 'java/src/com/android/inputmethod/latin/Suggest.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/Suggest.java | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/java/src/com/android/inputmethod/latin/Suggest.java b/java/src/com/android/inputmethod/latin/Suggest.java index 51ed09604..0418d3166 100644 --- a/java/src/com/android/inputmethod/latin/Suggest.java +++ b/java/src/com/android/inputmethod/latin/Suggest.java @@ -37,6 +37,11 @@ import java.util.concurrent.ConcurrentHashMap; public class Suggest { public static final String TAG = Suggest.class.getSimpleName(); + // Session id for + // {@link #getSuggestedWords(WordComposer,CharSequence,ProximityInfo,boolean,int)}. + public static final int SESSION_TYPING = 0; + public static final int SESSION_GESTURE = 1; + // TODO: rename this to CORRECTION_OFF public static final int CORRECTION_NONE = 0; // TODO: rename this to CORRECTION_ON @@ -157,13 +162,6 @@ public class Suggest { public SuggestedWords getSuggestedWords( final WordComposer wordComposer, CharSequence prevWordForBigram, - final ProximityInfo proximityInfo, final boolean isCorrectionEnabled) { - return getSuggestedWordsWithSessionId( - wordComposer, prevWordForBigram, proximityInfo, isCorrectionEnabled, 0); - } - - public SuggestedWords getSuggestedWordsWithSessionId( - final WordComposer wordComposer, CharSequence prevWordForBigram, final ProximityInfo proximityInfo, final boolean isCorrectionEnabled, int sessionId) { LatinImeLogger.onStartSuggestion(prevWordForBigram); if (wordComposer.isBatchMode()) { @@ -214,10 +212,12 @@ public class Suggest { whitelistedWord = suggestionsSet.first().mWord; } + // The word can be auto-corrected if it has a whitelist entry that is not itself, + // or if it's a 2+ characters non-word (i.e. it's not in the dictionary). final boolean allowsToBeAutoCorrected = (null != whitelistedWord && !whitelistedWord.equals(consideredWord)) - || AutoCorrection.isNotAWord(mDictionaries, consideredWord, - wordComposer.isFirstCharCapitalized()); + || (consideredWord.length() > 1 && !AutoCorrection.isInTheDictionary(mDictionaries, + consideredWord, wordComposer.isFirstCharCapitalized())); final boolean hasAutoCorrection; // TODO: using isCorrectionEnabled here is not very good. It's probably useless, because |