Package opennlp.tools.ml.maxent.io
Class GISModelReader
- java.lang.Object
-
- opennlp.tools.ml.model.AbstractModelReader
-
- opennlp.tools.ml.maxent.io.GISModelReader
-
- Direct Known Subclasses:
BinaryGISModelReader
,QNModelReader
public class GISModelReader extends AbstractModelReader
Abstract parent class for readers of GISModels.
-
-
Constructor Summary
Constructors Constructor Description GISModelReader(java.io.File file)
GISModelReader(DataReader dataReader)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
checkModelType()
AbstractModel
constructModel()
Retrieve a model from disk.-
Methods inherited from class opennlp.tools.ml.model.AbstractModelReader
getModel, readDouble, readInt, readUTF
-
-
-
-
Constructor Detail
-
GISModelReader
public GISModelReader(java.io.File file) throws java.io.IOException
- Throws:
java.io.IOException
-
GISModelReader
public GISModelReader(DataReader dataReader)
-
-
Method Detail
-
constructModel
public AbstractModel constructModel() throws java.io.IOException
Retrieve a model from disk. It assumes that models are saved in the following sequence:
GIS (model type identifier)
1. # of parameters (int)
2. the correction constant (int)
3. the correction constant parameter (double)
4. # of outcomes (int)
* list of outcome names (String)
5. # of different types of outcome patterns (int)
* list of (int int[])
[# of predicates for which outcome pattern is true] [outcome pattern]
6. # of predicates (int)
* list of predicate names (String)If you are creating a reader for a format which won't work with this (perhaps a database or xml file), override this method and ignore the other methods provided in this abstract class.
- Specified by:
constructModel
in classAbstractModelReader
- Returns:
- The GISModel stored in the format and location specified to this GISModelReader (usually via its the constructor).
- Throws:
java.io.IOException
-
checkModelType
public void checkModelType() throws java.io.IOException
- Specified by:
checkModelType
in classAbstractModelReader
- Throws:
java.io.IOException
-
-