diff options
author | 2014-06-27 09:11:36 +0000 | |
---|---|---|
committer | 2014-06-27 09:11:36 +0000 | |
commit | eb85cdce36a7f1eb7b20ea4658b5fbdcd7948ee1 (patch) | |
tree | 77b548f87fd8b918513551637d409de18022bdd7 /java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java | |
parent | c1d0d178916a49357ee668d108c8c933218e84b4 (diff) | |
parent | 17c5a388d6ada4dc395b52e56f8b18d63eebb863 (diff) | |
download | latinime-eb85cdce36a7f1eb7b20ea4658b5fbdcd7948ee1.tar.gz latinime-eb85cdce36a7f1eb7b20ea4658b5fbdcd7948ee1.tar.xz latinime-eb85cdce36a7f1eb7b20ea4658b5fbdcd7948ee1.zip |
am 17c5a388: Merge "Find multiple previous word information to support n-gram."
* commit '17c5a388d6ada4dc395b52e56f8b18d63eebb863':
Find multiple previous word information to support n-gram.
Diffstat (limited to 'java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java index ec57cd71f..15ddcf9ae 100644 --- a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java +++ b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java @@ -1882,10 +1882,11 @@ public final class InputLogic { final CharSequence chosenWordWithSuggestions = SuggestionSpanUtils.getTextWithSuggestionSpan(mLatinIME, chosenWord, suggestedWords); - // Use the 2nd previous word as the previous word because the 1st previous word is the word - // to be committed. + // When we are composing word, get previous words information from the 2nd previous word + // because the 1st previous word is the word to be committed. Otherwise get previous words + // information from the 1st previous word. final PrevWordsInfo prevWordsInfo = mConnection.getPrevWordsInfoFromNthPreviousWord( - settingsValues.mSpacingAndPunctuations, 2); + settingsValues.mSpacingAndPunctuations, mWordComposer.isComposingWord() ? 2 : 1); mConnection.commitText(chosenWordWithSuggestions, 1); // Add the word to the user history dictionary performAdditionToUserHistoryDictionary(settingsValues, chosenWord, prevWordsInfo); |