kylm.model.ngram.reader
Class NgramReader

java.lang.Object
  extended by kylm.model.ngram.reader.NgramReader
Direct Known Subclasses:
ArpaNgramReader, SerializedNgramReader

public abstract class NgramReader
extends java.lang.Object


Constructor Summary
NgramReader()
           
 
Method Summary
abstract  NgramLM read(java.io.InputStream is)
          Read a language model from an input stream
 NgramLM read(java.lang.String fileName)
          Read a language model from a file
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NgramReader

public NgramReader()
Method Detail

read

public NgramLM read(java.lang.String fileName)
             throws java.io.IOException
Read a language model from a file

Parameters:
fileName - The file to read the model from
Returns:
The model that has been read
Throws:
java.io.IOException - If the file could not be written to

read

public abstract NgramLM read(java.io.InputStream is)
                      throws java.io.IOException
Read a language model from an input stream

Parameters:
is - The input stream to read the model from
Returns:
The model that has been read
Throws:
java.io.IOException - If the file could not be read from