Package opennlp.tools.ml.perceptron
Class SuffixSensitivePerceptronModelWriter
- java.lang.Object
-
- opennlp.tools.ml.model.AbstractModelWriter
-
- opennlp.tools.ml.perceptron.PerceptronModelWriter
-
- opennlp.tools.ml.perceptron.SuffixSensitivePerceptronModelWriter
-
public class SuffixSensitivePerceptronModelWriter extends PerceptronModelWriter
A writer for GIS models which inspects the filename and invokes the appropriate GISModelWriter depending on the filename's suffixes.The following assumption are made about suffixes:
- .gz --> the file is gzipped (must be the last suffix)
- .txt --> the file is plain text
- .bin --> the file is binary
-
-
Constructor Summary
Constructors Constructor Description SuffixSensitivePerceptronModelWriter(AbstractModel model, java.io.File f)
Constructor which takes a GISModel and a File and invokes the GISModelWriter appropriate for the suffix.
-
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.perceptron.PerceptronModelWriter
persist
-
-
-
-
Constructor Detail
-
SuffixSensitivePerceptronModelWriter
public SuffixSensitivePerceptronModelWriter(AbstractModel model, java.io.File f) throws java.io.IOException
Constructor which takes a GISModel and a File and invokes the GISModelWriter appropriate for the suffix.- Parameters:
model
- The GISModel which is to be persisted.f
- The File in which the model is to be stored.- Throws:
java.io.IOException
-
-
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
-
-