diff options
author | 2013-09-30 01:02:30 -0700 | |
---|---|---|
committer | 2013-09-30 01:02:30 -0700 | |
commit | af5511c8309f6a5cfd12b8d4631b59ea0c43f66e (patch) | |
tree | 9464661c490dcbdc61056a22bddfd3954e4c472f /java/src/com/android/inputmethod/latin/makedict/BinaryDictEncoderUtils.java | |
parent | 2b73561cd7b445126583559a4f73c0a3707a3955 (diff) | |
parent | 25f47828539f4af34b081afb4553e9e56fbcdbf3 (diff) | |
download | latinime-af5511c8309f6a5cfd12b8d4631b59ea0c43f66e.tar.gz latinime-af5511c8309f6a5cfd12b8d4631b59ea0c43f66e.tar.xz latinime-af5511c8309f6a5cfd12b8d4631b59ea0c43f66e.zip |
am 25f47828: Merge "Separate bigram entries from the trie file."
* commit '25f47828539f4af34b081afb4553e9e56fbcdbf3':
Separate bigram entries from the trie file.
Diffstat (limited to 'java/src/com/android/inputmethod/latin/makedict/BinaryDictEncoderUtils.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/makedict/BinaryDictEncoderUtils.java | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/java/src/com/android/inputmethod/latin/makedict/BinaryDictEncoderUtils.java b/java/src/com/android/inputmethod/latin/makedict/BinaryDictEncoderUtils.java index 6cc0bfb76..af61f2979 100644 --- a/java/src/com/android/inputmethod/latin/makedict/BinaryDictEncoderUtils.java +++ b/java/src/com/android/inputmethod/latin/makedict/BinaryDictEncoderUtils.java @@ -385,12 +385,14 @@ public class BinaryDictEncoderUtils { nodeSize + size, ptNode.mChildren)); } nodeSize += getShortcutListSize(ptNode.mShortcutTargets); - if (null != ptNode.mBigrams) { - for (WeightedString bigram : ptNode.mBigrams) { - final int offset = getOffsetToTargetPtNodeDuringUpdate(ptNodeArray, - nodeSize + size + FormatSpec.PTNODE_ATTRIBUTE_FLAGS_SIZE, - FusionDictionary.findWordInTree(dict.mRootNodeArray, bigram.mWord)); - nodeSize += getByteSize(offset) + FormatSpec.PTNODE_ATTRIBUTE_FLAGS_SIZE; + if (formatOptions.mVersion < FormatSpec.FIRST_VERSION_WITH_TERMINAL_ID) { + if (null != ptNode.mBigrams) { + for (WeightedString bigram : ptNode.mBigrams) { + final int offset = getOffsetToTargetPtNodeDuringUpdate(ptNodeArray, + nodeSize + size + FormatSpec.PTNODE_ATTRIBUTE_FLAGS_SIZE, + FusionDictionary.findWordInTree(dict.mRootNodeArray, bigram.mWord)); + nodeSize += getByteSize(offset) + FormatSpec.PTNODE_ATTRIBUTE_FLAGS_SIZE; + } } } ptNode.mCachedSize = nodeSize; |