aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/LastComposedWord.java
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2012-02-21 23:11:07 -0800
committerJean Chalard <jchalard@google.com>2012-02-21 23:12:21 -0800
commitcf9d92629cae88273805eaf7984fcfdd8afd11f5 (patch)
tree0e42974e0a16159e64ef5ae51af36656a43415ee /java/src/com/android/inputmethod/latin/LastComposedWord.java
parentc6993e4947d0d2c5ac673fbaa99c816b69043074 (diff)
downloadlatinime-cf9d92629cae88273805eaf7984fcfdd8afd11f5.tar.gz
latinime-cf9d92629cae88273805eaf7984fcfdd8afd11f5.tar.xz
latinime-cf9d92629cae88273805eaf7984fcfdd8afd11f5.zip
Give LastComposedWord knowledge of the committed word (A1)
There is no point storing the prospective autocorrect - we are recomputing it anyway. The committed word however will be necessary to implement feature request #5968922. Change-Id: I588c18e1a5a1050a791d601de465f421ccbe36cd
Diffstat (limited to 'java/src/com/android/inputmethod/latin/LastComposedWord.java')
-rw-r--r--java/src/com/android/inputmethod/latin/LastComposedWord.java10
1 files changed, 5 insertions, 5 deletions
diff --git a/java/src/com/android/inputmethod/latin/LastComposedWord.java b/java/src/com/android/inputmethod/latin/LastComposedWord.java
index f34cb5ff9..37be03c3e 100644
--- a/java/src/com/android/inputmethod/latin/LastComposedWord.java
+++ b/java/src/com/android/inputmethod/latin/LastComposedWord.java
@@ -44,7 +44,7 @@ public class LastComposedWord {
public final int[] mXCoordinates;
public final int[] mYCoordinates;
public final String mTypedWord;
- public final String mAutoCorrection;
+ public final String mCommittedWord;
private boolean mActive;
@@ -54,12 +54,12 @@ public class LastComposedWord {
// Warning: this is using the passed objects as is and fully expects them to be
// immutable. Do not fiddle with their contents after you passed them to this constructor.
public LastComposedWord(final ArrayList<int[]> codes, final int[] xCoordinates,
- final int[] yCoordinates, final String typedWord, final String autoCorrection) {
+ final int[] yCoordinates, final String typedWord, final String committedWord) {
mCodes = codes;
mXCoordinates = xCoordinates;
mYCoordinates = yCoordinates;
mTypedWord = typedWord;
- mAutoCorrection = autoCorrection;
+ mCommittedWord = committedWord;
mActive = true;
}
@@ -68,7 +68,7 @@ public class LastComposedWord {
}
public boolean canCancelAutoCorrect() {
- return mActive && !TextUtils.isEmpty(mAutoCorrection)
- && !TextUtils.equals(mTypedWord, mAutoCorrection);
+ return mActive && !TextUtils.isEmpty(mCommittedWord)
+ && !TextUtils.equals(mTypedWord, mCommittedWord);
}
}