aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderUtils.java
diff options
context:
space:
mode:
authorKeisuke Kuroyanagi <ksk@google.com>2014-02-14 10:37:55 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-02-14 10:37:56 +0000
commit85fe06e759ab89c629caab5fb73de7ff0441d060 (patch)
tree36d7fd0ced83ccb8270586e8408987fbbcd7fc05 /java/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderUtils.java
parent36d606fcbc666c331ffaba02fe6b55afa4509348 (diff)
parent8e3a1d0f89ac5a0c7d31effb8cbb447f93f70310 (diff)
downloadlatinime-85fe06e759ab89c629caab5fb73de7ff0441d060.tar.gz
latinime-85fe06e759ab89c629caab5fb73de7ff0441d060.tar.xz
latinime-85fe06e759ab89c629caab5fb73de7ff0441d060.zip
Merge "Remove unused argument from readDictionaryBinary."
Diffstat (limited to 'java/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderUtils.java')
-rw-r--r--java/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderUtils.java34
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);
}
/**