aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java
diff options
context:
space:
mode:
authorKeisuke Kuroyanagi <ksk@google.com>2014-06-27 09:11:36 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-06-27 09:11:36 +0000
commiteb85cdce36a7f1eb7b20ea4658b5fbdcd7948ee1 (patch)
tree77b548f87fd8b918513551637d409de18022bdd7 /java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java
parentc1d0d178916a49357ee668d108c8c933218e84b4 (diff)
parent17c5a388d6ada4dc395b52e56f8b18d63eebb863 (diff)
downloadlatinime-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.java7
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);