Make readUnigramsAndBigramsBinary read linked-list nodes.

Change-Id: I07ae036b0b06e71d7a18f2bf11e4692cd4213568
main
Yuichiro Hanada 2012-09-19 18:00:32 +09:00
parent 54717534b1
commit 73779f7631
1 changed files with 12 additions and 1 deletions

View File

@ -92,7 +92,18 @@ public class BinaryDictIOUtils {
} }
if (p.mPosition == p.mNumOfCharGroup) { if (p.mPosition == p.mNumOfCharGroup) {
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(); stack.pop();
}
} else {
stack.pop();
}
} else { } else {
// the node has more groups. // the node has more groups.
p.mAddress = buffer.position(); p.mAddress = buffer.position();