From 73779f7631d41f16f89c62cae09a1b27d8189dc3 Mon Sep 17 00:00:00 2001 From: Yuichiro Hanada Date: Wed, 19 Sep 2012 18:00:32 +0900 Subject: [PATCH] Make readUnigramsAndBigramsBinary read linked-list nodes. Change-Id: I07ae036b0b06e71d7a18f2bf11e4692cd4213568 --- .../latin/makedict/BinaryDictIOUtils.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/java/src/com/android/inputmethod/latin/makedict/BinaryDictIOUtils.java b/java/src/com/android/inputmethod/latin/makedict/BinaryDictIOUtils.java index 7a1b9dcb7..406071071 100644 --- a/java/src/com/android/inputmethod/latin/makedict/BinaryDictIOUtils.java +++ b/java/src/com/android/inputmethod/latin/makedict/BinaryDictIOUtils.java @@ -92,7 +92,18 @@ public class BinaryDictIOUtils { } if (p.mPosition == p.mNumOfCharGroup) { - stack.pop(); + if (formatOptions.mHasLinkedListNode) { + final int forwardLinkAddress = buffer.readUnsignedInt24(); + if (forwardLinkAddress != FormatSpec.NO_FORWARD_LINK_ADDRESS) { + // the node has a forward link. + p.mNumOfCharGroup = Position.NOT_READ_GROUPCOUNT; + p.mAddress = forwardLinkAddress; + } else { + stack.pop(); + } + } else { + stack.pop(); + } } else { // the node has more groups. p.mAddress = buffer.position();