diff options
author | 2013-04-04 17:45:21 +0900 | |
---|---|---|
committer | 2013-04-09 12:05:54 +0900 | |
commit | 9310f42a36eabe99ed7dcd3b835d6cdaa3c6fdca (patch) | |
tree | 7dd337757f59fefa3c6e513fe6e7125f8b29df05 /java/src/com/android/inputmethod/latin/LatinIME.java | |
parent | a8d29082843cc22bb37fcd88ae581affdf0eaec7 (diff) | |
download | latinime-9310f42a36eabe99ed7dcd3b835d6cdaa3c6fdca.tar.gz latinime-9310f42a36eabe99ed7dcd3b835d6cdaa3c6fdca.tar.xz latinime-9310f42a36eabe99ed7dcd3b835d6cdaa3c6fdca.zip |
Offer to add any OOV typed word to the dictionary.
That includes gestures, which used not to work.
Bug: 8532637
Change-Id: I04606565d7000faadf954c4a806c39d4d162a2c1
Diffstat (limited to 'java/src/com/android/inputmethod/latin/LatinIME.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/LatinIME.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index 0fc26a80e..18a8023b8 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -72,6 +72,7 @@ import com.android.inputmethod.keyboard.KeyboardActionListener; import com.android.inputmethod.keyboard.KeyboardId; import com.android.inputmethod.keyboard.KeyboardSwitcher; import com.android.inputmethod.keyboard.MainKeyboardView; +import com.android.inputmethod.latin.SuggestedWords.SuggestedWordInfo; import com.android.inputmethod.latin.Utils.Stats; import com.android.inputmethod.latin.define.ProductionFlag; import com.android.inputmethod.latin.suggestions.SuggestionStripView; @@ -2174,8 +2175,9 @@ public final class LatinIME extends InputMethodService implements KeyboardAction // Called from {@link SuggestionStripView} through the {@link SuggestionStripView#Listener} // interface @Override - public void pickSuggestionManually(final int index, final String suggestion) { + public void pickSuggestionManually(final int index, final SuggestedWordInfo suggestionInfo) { final SuggestedWords suggestedWords = mSuggestedWords; + final String suggestion = suggestionInfo.mWord; // If this is a punctuation picked from the suggestion strip, pass it to onCodeInput if (suggestion.length() == 1 && isShowingPunctuationList()) { // Word separators are suggested before the user inputs something. @@ -2241,7 +2243,8 @@ public final class LatinIME extends InputMethodService implements KeyboardAction // AND it's in none of our current dictionaries (main, user or otherwise). // Please note that if mSuggest is null, it means that everything is off: suggestion // and correction, so we shouldn't try to show the hint - final boolean showingAddToDictionaryHint = index == 0 && mSuggest != null + final boolean showingAddToDictionaryHint = + SuggestedWordInfo.KIND_TYPED == suggestionInfo.mKind && mSuggest != null // If the suggestion is not in the dictionary, the hint should be shown. && !AutoCorrection.isValidWord(mSuggest.getUnigramDictionaries(), suggestion, true); |