aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/ExpandableBinaryDictionary.java
diff options
context:
space:
mode:
authorKeisuke Kuroyanagi <ksk@google.com>2014-05-27 09:04:29 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-05-27 09:04:29 +0000
commit060ac3cd284e5795f08b2057223480071877ff69 (patch)
treea56270cb65f4c1e8c8c094f19975e12e85e49625 /java/src/com/android/inputmethod/latin/ExpandableBinaryDictionary.java
parent871c001525af703c22c2a74d01d38315b152465c (diff)
parent3faf4fc5e776ec055d841e0dbe436fc418a60980 (diff)
downloadlatinime-060ac3cd284e5795f08b2057223480071877ff69.tar.gz
latinime-060ac3cd284e5795f08b2057223480071877ff69.tar.xz
latinime-060ac3cd284e5795f08b2057223480071877ff69.zip
am 3faf4fc5: Merge "Return whether the dynamic dict operation was success."
* commit '3faf4fc5e776ec055d841e0dbe436fc418a60980': Return whether the dynamic dict operation was success.
Diffstat (limited to 'java/src/com/android/inputmethod/latin/ExpandableBinaryDictionary.java')
-rw-r--r--java/src/com/android/inputmethod/latin/ExpandableBinaryDictionary.java12
1 files changed, 9 insertions, 3 deletions
diff --git a/java/src/com/android/inputmethod/latin/ExpandableBinaryDictionary.java b/java/src/com/android/inputmethod/latin/ExpandableBinaryDictionary.java
index 95ff8c6e3..b10bae01a 100644
--- a/java/src/com/android/inputmethod/latin/ExpandableBinaryDictionary.java
+++ b/java/src/com/android/inputmethod/latin/ExpandableBinaryDictionary.java
@@ -298,8 +298,10 @@ abstract public class ExpandableBinaryDictionary extends Dictionary {
protected void addUnigramLocked(final String word, final int frequency,
final String shortcutTarget, final int shortcutFreq, final boolean isNotAWord,
final boolean isBlacklisted, final int timestamp) {
- mBinaryDictionary.addUnigramEntry(word, frequency, shortcutTarget, shortcutFreq,
- false /* isBeginningOfSentence */, isNotAWord, isBlacklisted, timestamp);
+ if (!mBinaryDictionary.addUnigramEntry(word, frequency, shortcutTarget, shortcutFreq,
+ false /* isBeginningOfSentence */, isNotAWord, isBlacklisted, timestamp)) {
+ Log.e(TAG, "Cannot add unigram entry. word: " + word);
+ }
}
/**
@@ -322,7 +324,11 @@ abstract public class ExpandableBinaryDictionary extends Dictionary {
protected void addNgramEntryLocked(final PrevWordsInfo prevWordsInfo, final String word,
final int frequency, final int timestamp) {
- mBinaryDictionary.addNgramEntry(prevWordsInfo, word, frequency, timestamp);
+ if (!mBinaryDictionary.addNgramEntry(prevWordsInfo, word, frequency, timestamp)) {
+ Log.e(TAG, "Cannot add n-gram entry.");
+ Log.e(TAG, " PrevWordsInfo: " + prevWordsInfo);
+ Log.e(TAG, " word: " + word);
+ }
}
/**