aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src/com/android/inputmethod/latin/makedict/Ver4DictEncoder.java
diff options
context:
space:
mode:
Diffstat (limited to 'tests/src/com/android/inputmethod/latin/makedict/Ver4DictEncoder.java')
-rw-r--r--tests/src/com/android/inputmethod/latin/makedict/Ver4DictEncoder.java24
1 files changed, 4 insertions, 20 deletions
diff --git a/tests/src/com/android/inputmethod/latin/makedict/Ver4DictEncoder.java b/tests/src/com/android/inputmethod/latin/makedict/Ver4DictEncoder.java
index 1e4bd768c..6e7b37d54 100644
--- a/tests/src/com/android/inputmethod/latin/makedict/Ver4DictEncoder.java
+++ b/tests/src/com/android/inputmethod/latin/makedict/Ver4DictEncoder.java
@@ -74,26 +74,10 @@ public class Ver4DictEncoder implements DictEncoder {
throw new IOException("Cannot create dictionary file");
}
for (final WordProperty wordProperty : dict) {
- // TODO: switch to addMultipleDictionaryEntries when they support shortcuts
- if (null == wordProperty.mShortcutTargets || wordProperty.mShortcutTargets.isEmpty()) {
- if (!binaryDict.addUnigramEntry(wordProperty.mWord, wordProperty.getProbability(),
- null /* shortcutTarget */, 0 /* shortcutProbability */,
- wordProperty.mIsBeginningOfSentence, wordProperty.mIsNotAWord,
- wordProperty.mIsPossiblyOffensive, 0 /* timestamp */)) {
- MakedictLog.e("Cannot add unigram entry for " + wordProperty.mWord);
- }
- } else {
- for (final WeightedString shortcutTarget : wordProperty.mShortcutTargets) {
- if (!binaryDict.addUnigramEntry(wordProperty.mWord,
- wordProperty.getProbability(),
- shortcutTarget.mWord, shortcutTarget.getProbability(),
- wordProperty.mIsBeginningOfSentence, wordProperty.mIsNotAWord,
- wordProperty.mIsPossiblyOffensive, 0 /* timestamp */)) {
- MakedictLog.e("Cannot add unigram entry for " + wordProperty.mWord
- + ", shortcutTarget: " + shortcutTarget.mWord);
- return;
- }
- }
+ if (!binaryDict.addUnigramEntry(wordProperty.mWord, wordProperty.getProbability(),
+ wordProperty.mIsBeginningOfSentence, wordProperty.mIsNotAWord,
+ wordProperty.mIsPossiblyOffensive, 0 /* timestamp */)) {
+ MakedictLog.e("Cannot add unigram entry for " + wordProperty.mWord);
}
if (binaryDict.needsToRunGC(true /* mindsBlockByGC */)) {
if (!binaryDict.flushWithGC()) {