com.aliasi.lm
Class MultiTrieReader

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

public class MultiTrieReader
extends Object
implements TrieReader

A MultiTrieReader merges two trie readers, providing output that is the result of adding the counts from the two readers.

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

Constructor Summary
MultiTrieReader(TrieReader reader1, TrieReader reader2)
          Construct a multiple trie reader that returns counts that are the sum of the two readers' counts.
 
Method Summary
 long readCount()
          Returns the count of the next tree.
 long readSymbol()
          Returns the identifier of the symbol leading from the root of the current tree to the daughter subtree for the symbol, or -1 if there are no more subtrees for the current node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultiTrieReader

public MultiTrieReader(TrieReader reader1,
                       TrieReader reader2)
Construct a multiple trie reader that returns counts that are the sum of the two readers' counts.

Parameters:
reader1 - First reader.
reader2 - Second reader.
Method Detail

readSymbol

public long readSymbol()
                throws IOException
Description copied from interface: TrieReader
Returns the identifier of the symbol leading from the root of the current tree to the daughter subtree for the symbol, or -1 if there are no more subtrees for the current node.

Specified by:
readSymbol in interface TrieReader
Returns:
The symbol leading to the next subtree.
Throws:
IOException - If there is an underlying I/O error.

readCount

public long readCount()
               throws IOException
Description copied from interface: TrieReader
Returns the count of the next tree.

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