diff options
author | 2014-02-14 18:31:41 +0900 | |
---|---|---|
committer | 2014-02-14 19:02:15 +0900 | |
commit | 8e3a1d0f89ac5a0c7d31effb8cbb447f93f70310 (patch) | |
tree | c2d937cb1a9e7b6fe71c4c886dc142d635c51ff6 /java/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderUtils.java | |
parent | c63d183473390dbe6ddef37df48b36ae49de3f29 (diff) | |
download | latinime-8e3a1d0f89ac5a0c7d31effb8cbb447f93f70310.tar.gz latinime-8e3a1d0f89ac5a0c7d31effb8cbb447f93f70310.tar.xz latinime-8e3a1d0f89ac5a0c7d31effb8cbb447f93f70310.zip |
Remove unused argument from readDictionaryBinary.
Bug: 12810574
Change-Id: Ice415ebd8d11162facca3fe8927ef8a616b11424
Diffstat (limited to 'java/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderUtils.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderUtils.java | 34 |
1 files changed, 5 insertions, 29 deletions
diff --git a/java/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderUtils.java b/java/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderUtils.java index fc5788de9..845299c99 100644 --- a/java/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderUtils.java +++ b/java/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderUtils.java @@ -500,16 +500,14 @@ public final class BinaryDictDecoderUtils { * Reads a buffer and returns the memory representation of the dictionary. * * This high-level method takes a buffer and reads its contents, populating a - * FusionDictionary structure. The optional dict argument is an existing dictionary to - * which words from the buffer should be added. If it is null, a new dictionary is created. + * FusionDictionary structure. * * @param dictDecoder the dict decoder. - * @param dict an optional dictionary to add words to, or null. - * @return the created (or merged) dictionary. + * @return the created dictionary. */ @UsedForTesting - /* package */ static FusionDictionary readDictionaryBinary(final DictDecoder dictDecoder, - final FusionDictionary dict) throws IOException, UnsupportedFormatException { + /* package */ static FusionDictionary readDictionaryBinary(final DictDecoder dictDecoder) + throws IOException, UnsupportedFormatException { // Read header final DictionaryHeader fileHeader = dictDecoder.readHeader(); @@ -517,29 +515,7 @@ public final class BinaryDictDecoderUtils { Map<Integer, PtNode> reversePtNodeMapping = new TreeMap<Integer, PtNode>(); final PtNodeArray root = readNodeArray(dictDecoder, fileHeader.mBodyOffset, reverseNodeArrayMapping, reversePtNodeMapping, fileHeader.mFormatOptions); - - FusionDictionary newDict = new FusionDictionary(root, fileHeader.mDictionaryOptions); - if (null != dict) { - for (final WordProperty wordProperty : dict) { - if (wordProperty.mIsBlacklistEntry) { - newDict.addBlacklistEntry(wordProperty.mWord, wordProperty.mShortcutTargets, - wordProperty.mIsNotAWord); - } else { - newDict.add(wordProperty.mWord, wordProperty.mProbabilityInfo, - wordProperty.mShortcutTargets, wordProperty.mIsNotAWord); - } - } - for (final WordProperty wordProperty : 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 : wordProperty.mBigrams) { - newDict.setBigram(wordProperty.mWord, bigram.mWord, bigram.mProbabilityInfo); - } - } - } - - return newDict; + return new FusionDictionary(root, fileHeader.mDictionaryOptions); } /** |