kylm.model.ngram.writer
Class NgramWriter
java.lang.Object
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
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 |
NgramWriter
public NgramWriter()
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 writefileName
- 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 writeos
- The output stream to write to
- Throws:
java.io.IOException
- If there was an error during output