diff options
author | 2014-06-27 09:07:09 +0000 | |
---|---|---|
committer | 2014-06-26 23:14:58 +0000 | |
commit | 17c5a388d6ada4dc395b52e56f8b18d63eebb863 (patch) | |
tree | a00fc6579e1ea949e59c3466dd623d4237ba764a /java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java | |
parent | c9c3ea0b68a1bad1febb7532fa941b430a1b941a (diff) | |
parent | 1c2f1ada8305e36defa8572da687a4596bf083ea (diff) | |
download | latinime-17c5a388d6ada4dc395b52e56f8b18d63eebb863.tar.gz latinime-17c5a388d6ada4dc395b52e56f8b18d63eebb863.tar.xz latinime-17c5a388d6ada4dc395b52e56f8b18d63eebb863.zip |
Merge "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); |