public final class TreeDecoder extends Object implements Decoder, Serializable
Additional, the buildCodes()
method returns a vector
of codewords corresponding to the paths of an instance of this class. Conversely,
the codeword-based constructor builds
a tree out of the codewords generated by root-to-leaf paths.
Modifier and Type | Class and Description |
---|---|
static class |
TreeDecoder.LeafNode
A leaf node of the decoding tree.
|
static class |
TreeDecoder.Node
A internal node of the decoding tree.
|
Constructor and Description |
---|
TreeDecoder(BitVector[] lexSortedCodeWord,
int[] symbol)
Creates a new codeword-based decoder starting from a set
of complete, lexicographically ordered codewords.
|
TreeDecoder(TreeDecoder.Node root,
int n)
Creates a new codeword-based decoder using the given tree.
|
Modifier and Type | Method and Description |
---|---|
BitVector[] |
buildCodes()
Generate the codewords corresponding to this tree decoder.
|
int |
decode(it.unimi.dsi.fastutil.booleans.BooleanIterator iterator)
Decodes the next symbol from the given boolean iterator.
|
int |
decode(InputBitStream ibs)
Decodes the next symbol from the given input bit stream.
|
public TreeDecoder(TreeDecoder.Node root, int n)
TreeDecoder.Node
and all leaf nodes are instances of TreeDecoder.LeafNode
.root
- the root of a decoding tree.n
- the number of leaves (symbols).public TreeDecoder(BitVector[] lexSortedCodeWord, int[] symbol)
lexSortedCodeWord
- a vector of lexically sorted codeWords.symbol
- a mapping from codewords to symbols.public int decode(it.unimi.dsi.fastutil.booleans.BooleanIterator iterator)
Decoder
Note that InputBitStream
implements BooleanIterator
.
public int decode(InputBitStream ibs) throws IOException
Decoder
Note that InputBitStream
implements BooleanIterator
.
decode
in interface Decoder
ibs
- an input bit stream.ibs
.IOException
public BitVector[] buildCodes()
Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.