Package opennlp.tools.ml.maxent.io
Class BinaryGISModelWriter
- java.lang.Object
-
- opennlp.tools.ml.model.AbstractModelWriter
-
- opennlp.tools.ml.maxent.io.GISModelWriter
-
- opennlp.tools.ml.maxent.io.BinaryGISModelWriter
-
public class BinaryGISModelWriter extends GISModelWriter
Model writer that saves models in binary format.
-
-
Constructor Summary
Constructors Constructor Description BinaryGISModelWriter(AbstractModel model, java.io.DataOutputStream dos)
Constructor which takes a GISModel and a DataOutputStream and prepares itself to write the model to that stream.BinaryGISModelWriter(AbstractModel model, java.io.File f)
Constructor which takes a GISModel and a File and prepares itself to write the model to that file.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
void
writeDouble(double d)
void
writeInt(int i)
void
writeUTF(java.lang.String s)
-
Methods inherited from class opennlp.tools.ml.maxent.io.GISModelWriter
persist
-
-
-
-
Constructor Detail
-
BinaryGISModelWriter
public BinaryGISModelWriter(AbstractModel model, java.io.File f) throws java.io.IOException
Constructor which takes a GISModel and a File and prepares itself to write the model to that file. Detects whether the file is gzipped or not based on whether the suffix contains ".gz".- Parameters:
model
- The GISModel which is to be persisted.f
- The File in which the model is to be persisted.- Throws:
java.io.IOException
-
BinaryGISModelWriter
public BinaryGISModelWriter(AbstractModel model, java.io.DataOutputStream dos)
Constructor which takes a GISModel and a DataOutputStream and prepares itself to write the model to that stream.- Parameters:
model
- The GISModel which is to be persisted.dos
- The stream which will be used to persist the model.
-
-
Method Detail
-
writeUTF
public void writeUTF(java.lang.String s) throws java.io.IOException
- Specified by:
writeUTF
in classAbstractModelWriter
- Throws:
java.io.IOException
-
writeInt
public void writeInt(int i) throws java.io.IOException
- Specified by:
writeInt
in classAbstractModelWriter
- Throws:
java.io.IOException
-
writeDouble
public void writeDouble(double d) throws java.io.IOException
- Specified by:
writeDouble
in classAbstractModelWriter
- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException
- Specified by:
close
in classAbstractModelWriter
- Throws:
java.io.IOException
-
-