diff options
author | 2014-05-20 14:00:45 +0000 | |
---|---|---|
committer | 2014-05-20 14:01:06 +0000 | |
commit | 4e21d3711fb65e5b7ef24b2db7b5f2504365d5e3 (patch) | |
tree | db692be994a4fc468dc754b1d86be77b772d29d8 /java/src/com/android/inputmethod/latin/WordComposer.java | |
parent | ff50b39176370ab80a33bfdcf9979603c08a88b3 (diff) | |
download | latinime-4e21d3711fb65e5b7ef24b2db7b5f2504365d5e3.tar.gz latinime-4e21d3711fb65e5b7ef24b2db7b5f2504365d5e3.tar.xz latinime-4e21d3711fb65e5b7ef24b2db7b5f2504365d5e3.zip |
Revert "Use PrevWordsInfo for get/add/remove n-gram(bigram) entry."
This reverts commit ff50b39176370ab80a33bfdcf9979603c08a88b3.
Bug: 14119293
Bug: 14425059
Bug: 15102610
Change-Id: If278b4ab236e38d20d8cdc0761b0438911bd4ff9
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, 6 insertions, 5 deletions
diff --git a/java/src/com/android/inputmethod/latin/WordComposer.java b/java/src/com/android/inputmethod/latin/WordComposer.java index 09e905481..227b42bde 100644 --- a/java/src/com/android/inputmethod/latin/WordComposer.java +++ b/java/src/com/android/inputmethod/latin/WordComposer.java @@ -294,10 +294,11 @@ 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 prevWordsInfo the information of previous words, to use as context for suggestions + * @param previousWord the previous word, to use as context for suggestions. Can be null if + * the context is nil (typically, at start of text). */ public void setComposingWord(final int[] codePoints, final int[] coordinates, - final PrevWordsInfo prevWordsInfo) { + final CharSequence previousWord) { reset(); final int length = codePoints.length; for (int i = 0; i < length; ++i) { @@ -306,7 +307,7 @@ public final class WordComposer { CoordinateUtils.yFromArray(coordinates, i))); } mIsResumed = true; - mPrevWordsInfo = prevWordsInfo; + mPrevWordsInfo = new PrevWordsInfo(null == previousWord ? null : previousWord.toString()); } /** @@ -412,13 +413,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 PrevWordsInfo prevWordsInfo) { + final String separatorString, final String prevWord) { // 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, - prevWordsInfo, mCapitalizedMode); + prevWord, mCapitalizedMode); mInputPointers.reset(); if (type != LastComposedWord.COMMIT_TYPE_DECIDED_WORD && type != LastComposedWord.COMMIT_TYPE_MANUAL_PICK) { |