|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectopennlp.maxent.io.GISModelReader
public abstract class GISModelReader
Abstract parent class for readers of GISModels.
Field Summary | |
---|---|
protected int |
NUM_PREDS
The number of predicates contained in the model. |
Constructor Summary | |
---|---|
GISModelReader()
|
Method Summary | |
---|---|
protected void |
checkModelType()
|
protected int |
getCorrectionConstant()
|
protected double |
getCorrectionParameter()
|
GISModel |
getModel()
Retrieve a model from disk. |
protected int[][] |
getOutcomePatterns()
|
protected java.lang.String[] |
getOutcomes()
|
protected Context[] |
getParameters(int[][] outcomePatterns)
Reads the parameters from a file and populates an array of context objects. |
protected java.lang.String[] |
getPredicates()
|
protected abstract double |
readDouble()
Implement as needed for the format the model is stored in. |
protected abstract int |
readInt()
Implement as needed for the format the model is stored in. |
protected abstract java.lang.String |
readUTF()
Implement as needed for the format the model is stored in. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected int NUM_PREDS
Constructor Detail |
---|
public GISModelReader()
Method Detail |
---|
protected abstract int readInt() throws java.io.IOException
java.io.IOException
protected abstract double readDouble() throws java.io.IOException
java.io.IOException
protected abstract java.lang.String readUTF() throws java.io.IOException
java.io.IOException
public GISModel getModel() throws java.io.IOException
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.
java.io.IOException
protected void checkModelType() throws java.io.IOException
java.io.IOException
protected int getCorrectionConstant() throws java.io.IOException
java.io.IOException
protected double getCorrectionParameter() throws java.io.IOException
java.io.IOException
protected java.lang.String[] getOutcomes() throws java.io.IOException
java.io.IOException
protected int[][] getOutcomePatterns() throws java.io.IOException
java.io.IOException
protected java.lang.String[] getPredicates() throws java.io.IOException
java.io.IOException
protected Context[] getParameters(int[][] outcomePatterns) throws java.io.IOException
outcomePatterns
- The outcomes patterns for the model. The first index refers to which
outcome pattern (a set of outcomes that occurs with a context) is being specified. The
second index specifies the number of contexts which use this pattern at index 0, and the
index of each outcomes which make up this pattern in indicies 1-n.
java.io.IOException
- when the model file does not match the outcome patterns or can not be read.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |