kylm.model.ngram.writer
Class NgramWriter

java.lang.Object
  extended by kylm.model.ngram.writer.NgramWriter
Direct Known Subclasses:
ArpaNgramWriter, SerializedNgramWriter, WFSTNgramWriter

public abstract class NgramWriter
extends java.lang.Object

An abstract class the defines the functions needed to write an n-gram model to a file or output stream.

Author:
neubig

Constructor Summary
NgramWriter()
           
 
Method Summary
abstract  void write(NgramLM lm, java.io.OutputStream os)
          Write the language model to a generic output stream
 void write(NgramLM lm, java.lang.String fileName)
          Write the language model to a file.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NgramWriter

public NgramWriter()
Method Detail

write

public void write(NgramLM lm,
                  java.lang.String fileName)
           throws java.io.IOException
Write the language model to a file.

Parameters:
lm - The language model to write
fileName - The file to write it to
Throws:
java.io.IOException - If the file could not be written to

write

public abstract void write(NgramLM lm,
                           java.io.OutputStream os)
                    throws java.io.IOException
Write the language model to a generic output stream

Parameters:
lm - The language model to write
os - The output stream to write to
Throws:
java.io.IOException - If there was an error during output