diff options
author | 2012-04-26 00:26:04 -0700 | |
---|---|---|
committer | 2012-04-26 00:26:04 -0700 | |
commit | 329c8d7bcce4f785fa6e31df6cbda0c11014d49b (patch) | |
tree | 46422150264576bd55de53282141012a05938789 /java/src/com/android/inputmethod/latin/makedict/BinaryDictInputOutput.java | |
parent | 604599c38913cc1cce38cf5f5b018b5507cf3766 (diff) | |
parent | 44c64f46a143623dd793facd889c8d6eab5e230c (diff) | |
download | latinime-329c8d7bcce4f785fa6e31df6cbda0c11014d49b.tar.gz latinime-329c8d7bcce4f785fa6e31df6cbda0c11014d49b.tar.xz latinime-329c8d7bcce4f785fa6e31df6cbda0c11014d49b.zip |
Merge "Ignore bigrams that are not also listed as unigrams" into jb-dev
Diffstat (limited to 'java/src/com/android/inputmethod/latin/makedict/BinaryDictInputOutput.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/makedict/BinaryDictInputOutput.java | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/java/src/com/android/inputmethod/latin/makedict/BinaryDictInputOutput.java b/java/src/com/android/inputmethod/latin/makedict/BinaryDictInputOutput.java index cc98010fb..88da7b0d8 100644 --- a/java/src/com/android/inputmethod/latin/makedict/BinaryDictInputOutput.java +++ b/java/src/com/android/inputmethod/latin/makedict/BinaryDictInputOutput.java @@ -1317,8 +1317,16 @@ public class BinaryDictInputOutput { 0 != (optionsFlags & GERMAN_UMLAUT_PROCESSING_FLAG), 0 != (optionsFlags & FRENCH_LIGATURE_PROCESSING_FLAG))); if (null != dict) { - for (Word w : dict) { - newDict.add(w.mWord, w.mFrequency, w.mShortcutTargets, w.mBigrams); + for (final Word w : dict) { + newDict.add(w.mWord, w.mFrequency, w.mShortcutTargets); + } + for (final Word w : dict) { + // By construction a binary dictionary may not have bigrams pointing to + // words that are not also registered as unigrams so we don't have to avoid + // them explicitly here. + for (final WeightedString bigram : w.mBigrams) { + newDict.setBigram(w.mWord, bigram.mWord, bigram.mFrequency); + } } } |