diff options
author | 2014-05-21 11:15:38 +0900 | |
---|---|---|
committer | 2014-05-21 11:15:38 +0900 | |
commit | e507d92aa3ee4ae43124c5452f20aa8ed0ecef4c (patch) | |
tree | 7f21c8bf2fe1a67c4fa7e71d58a0708623304f8e /java/src/com/android/inputmethod/latin/WordComposer.java | |
parent | 06dd0ef877d0ed1027a326769274c1f00f8bbf35 (diff) | |
download | latinime-e507d92aa3ee4ae43124c5452f20aa8ed0ecef4c.tar.gz latinime-e507d92aa3ee4ae43124c5452f20aa8ed0ecef4c.tar.xz latinime-e507d92aa3ee4ae43124c5452f20aa8ed0ecef4c.zip |
Use PrevWordsInfo for get/add/remove n-gram(bigram) entry.
Bug: 14119293
Bug: 14425059
Bug: 15102610
Change-Id: Ib482390f8d15b37d44a1a54e8c243a9eaec3f815
Diffstat (limited to 'java/src/com/android/inputmethod/latin/WordComposer.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/WordComposer.java | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/java/src/com/android/inputmethod/latin/WordComposer.java b/java/src/com/android/inputmethod/latin/WordComposer.java index 227b42bde..09e905481 100644 --- a/java/src/com/android/inputmethod/latin/WordComposer.java +++ b/java/src/com/android/inputmethod/latin/WordComposer.java @@ -294,11 +294,10 @@ public final class WordComposer { * This will register NOT_A_COORDINATE for X and Ys, and use the passed keyboard for proximity. * @param codePoints the code points to set as the composing word. * @param coordinates the x, y coordinates of the key in the CoordinateUtils format - * @param previousWord the previous word, to use as context for suggestions. Can be null if - * the context is nil (typically, at start of text). + * @param prevWordsInfo the information of previous words, to use as context for suggestions */ public void setComposingWord(final int[] codePoints, final int[] coordinates, - final CharSequence previousWord) { + final PrevWordsInfo prevWordsInfo) { reset(); final int length = codePoints.length; for (int i = 0; i < length; ++i) { @@ -307,7 +306,7 @@ public final class WordComposer { CoordinateUtils.yFromArray(coordinates, i))); } mIsResumed = true; - mPrevWordsInfo = new PrevWordsInfo(null == previousWord ? null : previousWord.toString()); + mPrevWordsInfo = prevWordsInfo; } /** @@ -413,13 +412,13 @@ public final class WordComposer { // `type' should be one of the LastComposedWord.COMMIT_TYPE_* constants above. // committedWord should contain suggestion spans if applicable. public LastComposedWord commitWord(final int type, final CharSequence committedWord, - final String separatorString, final String prevWord) { + final String separatorString, final PrevWordsInfo prevWordsInfo) { // Note: currently, we come here whenever we commit a word. If it's a MANUAL_PICK // or a DECIDED_WORD we may cancel the commit later; otherwise, we should deactivate // the last composed word to ensure this does not happen. final LastComposedWord lastComposedWord = new LastComposedWord(mEvents, mInputPointers, mTypedWordCache.toString(), committedWord, separatorString, - prevWord, mCapitalizedMode); + prevWordsInfo, mCapitalizedMode); mInputPointers.reset(); if (type != LastComposedWord.COMMIT_TYPE_DECIDED_WORD && type != LastComposedWord.COMMIT_TYPE_MANUAL_PICK) { |