diff options
author | 2012-04-26 00:30:37 -0700 | |
---|---|---|
committer | 2012-04-26 00:30:37 -0700 | |
commit | a3c00c1530af0c5460c502fdac0873fa4b94e93e (patch) | |
tree | 46422150264576bd55de53282141012a05938789 /java/src/com/android/inputmethod/latin/makedict/BinaryDictInputOutput.java | |
parent | b096e3f5899f5397589cc6ef0edf1c5ab5d43513 (diff) | |
parent | 329c8d7bcce4f785fa6e31df6cbda0c11014d49b (diff) | |
download | latinime-a3c00c1530af0c5460c502fdac0873fa4b94e93e.tar.gz latinime-a3c00c1530af0c5460c502fdac0873fa4b94e93e.tar.xz latinime-a3c00c1530af0c5460c502fdac0873fa4b94e93e.zip |
am 329c8d7b: Merge "Ignore bigrams that are not also listed as unigrams" into jb-dev
* commit '329c8d7bcce4f785fa6e31df6cbda0c11014d49b':
Ignore bigrams that are not also listed as unigrams
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); + } } } |