com.aliasi.lm
Class BitTrieReader

java.lang.Object
  extended by com.aliasi.lm.BitTrieReader
All Implemented Interfaces:
TrieReader

public class BitTrieReader
extends Object
implements TrieReader

A BitTrieReader provides a trie reader that wraps a bit-level input.

The encoding is discussed in the class documentation for the corresponding writer, BitTrieWriter.

Since:
LingPipe2.3
Version:
2.3
Author:
Bob Carpenter

Constructor Summary
BitTrieReader(BitInput bitInput)
          Construct a bit trie reader from the specified bit input.
 
Method Summary
 long readCount()
          Read and return the next count from the underlying bit input.
 long readSymbol()
          Read and return the next symbol from the underlying bit input.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BitTrieReader

public BitTrieReader(BitInput bitInput)
Construct a bit trie reader from the specified bit input.

Parameters:
bitInput - Bit input from which to read the trie.
Method Detail

readCount

public long readCount()
               throws IOException
Read and return the next count from the underlying bit input.

Specified by:
readCount in interface TrieReader
Returns:
The next count.
Throws:
IOException - If there is an underlying I/O error.

readSymbol

public long readSymbol()
                throws IOException
Read and return the next symbol from the underlying bit input. Returns -1 if there are no more daughters to read in the current trie node.

Specified by:
readSymbol in interface TrieReader
Returns:
The next count.
Throws:
IOException - If there is an underlying I/O error.