diff options
author | 2012-04-20 19:58:01 +0900 | |
---|---|---|
committer | 2012-04-26 15:20:30 +0900 | |
commit | 44c64f46a143623dd793facd889c8d6eab5e230c (patch) | |
tree | ba0fb1c4d704433a663e5bdc7f6c68253792c625 /java/src/com/android/inputmethod/latin/makedict/BinaryDictInputOutput.java | |
parent | 49caddbdabe5ca666bdef9f842f134e30e7ffed9 (diff) | |
download | latinime-44c64f46a143623dd793facd889c8d6eab5e230c.tar.gz latinime-44c64f46a143623dd793facd889c8d6eab5e230c.tar.xz latinime-44c64f46a143623dd793facd889c8d6eab5e230c.zip |
Ignore bigrams that are not also listed as unigrams
This is a cherry pick of I14b67e51 on jb-dev
Bug: 6340915
Change-Id: Iaa512abe1b19ca640ea201f9761fd7f1416270ed
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); + } } } |