aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/UserHistoryDictionary.java
diff options
context:
space:
mode:
authorsatok <satok@google.com>2012-05-23 20:17:10 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2012-05-23 20:17:10 -0700
commit925212ff4b3d6ff4182a94a133c0e4a4f23dd6aa (patch)
tree04337df6e245c67380ec8866237aa1a3029255e8 /java/src/com/android/inputmethod/latin/UserHistoryDictionary.java
parent074e8c920683d77fae191b34185193c896e3aa00 (diff)
parentc54d558e2e70bdfb2c1078cae7b88440d421dc67 (diff)
downloadlatinime-925212ff4b3d6ff4182a94a133c0e4a4f23dd6aa.tar.gz
latinime-925212ff4b3d6ff4182a94a133c0e4a4f23dd6aa.tar.xz
latinime-925212ff4b3d6ff4182a94a133c0e4a4f23dd6aa.zip
am c54d558e: Cancel adding user history bigram when autocorrection is cancelled
* commit 'c54d558e2e70bdfb2c1078cae7b88440d421dc67': Cancel adding user history bigram when autocorrection is cancelled
Diffstat (limited to 'java/src/com/android/inputmethod/latin/UserHistoryDictionary.java')
-rw-r--r--java/src/com/android/inputmethod/latin/UserHistoryDictionary.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/java/src/com/android/inputmethod/latin/UserHistoryDictionary.java b/java/src/com/android/inputmethod/latin/UserHistoryDictionary.java
index e13602e50..efafacc8a 100644
--- a/java/src/com/android/inputmethod/latin/UserHistoryDictionary.java
+++ b/java/src/com/android/inputmethod/latin/UserHistoryDictionary.java
@@ -202,6 +202,15 @@ public class UserHistoryDictionary extends ExpandableDictionary {
return freq;
}
+ public boolean cancelAddingUserHistory(String word1, String word2) {
+ final Bigram bi = new Bigram(word1, word2, 0);
+ if (mPendingWrites.contains(bi)) {
+ mPendingWrites.remove(bi);
+ return super.removeBigram(word1, word2);
+ }
+ return false;
+ }
+
/**
* Schedules a background thread to write any pending words to the database.
*/