|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.illinois.cs.cogcomp.lbj.coref.decoders.DecoderWithOptions<ST>
ST - The solution type.public abstract class DecoderWithOptions<ST extends Solution>
Abstract class for decoding some set of predictions into an arbitrary solution type.
| Field Summary | |
|---|---|
protected java.util.Map<java.lang.String,java.lang.String> |
m_options
|
protected boolean |
m_train
|
| Constructor Summary | |
|---|---|
DecoderWithOptions()
Construct a decoder. |
|
| Method Summary | |
|---|---|
abstract ST |
decode(Doc doc)
Decode a document into a solution. |
boolean |
getBooleanOption(java.lang.String option)
Gets the value of the option interpreted as a boolean. |
java.lang.String |
getOption(java.lang.String option)
Gets the string value of some option. |
double |
getRealOption(java.lang.String option,
double defaultVal)
Gets the value of the option interpreted as a real number. |
void |
processOption(java.lang.String option,
java.lang.String value)
Handles option changes when they happen (when setOption is called). |
void |
setOption(java.lang.String option,
boolean value)
Sets the option to a boolean value. |
void |
setOption(java.lang.String option,
double value)
Sets the option to a real value. |
void |
setOption(java.lang.String option,
java.lang.String value)
Sets the value of some option. |
void |
setTrain(boolean train)
Specify whether the algorithm is training during decode. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.util.Map<java.lang.String,java.lang.String> m_options
protected boolean m_train
| Constructor Detail |
|---|
public DecoderWithOptions()
| Method Detail |
|---|
public abstract ST decode(Doc doc)
decode in interface SolutionDecoder<ST extends Solution>doc - A document to process.
public java.lang.String getOption(java.lang.String option)
option - The name of the option to get.
p,
or null if not defined and no default specified.public boolean getBooleanOption(java.lang.String option)
super.
option - The name of the option.
option
as defined by Boolean.parseBoolean,
or false if not defined and no default specified.
public double getRealOption(java.lang.String option,
double defaultVal)
option - The name of the option.defaultVal - The default value.
>option
as defined by Double.parseDouble,
or defaultVal if not defined.
public void setOption(java.lang.String option,
java.lang.String value)
super.setOption(String, String).
If super.setOption(String, String) is called,
no need to override setOption(String, boolean).
However, to add more options,
consider overriding processOption instead.
option - The name of the option.value - The desired value.
public void setOption(java.lang.String option,
boolean value)
setOption(String, String) instead.
setOption in interface SolutionDecoder<ST extends Solution>option - The name of the option.value - The desired value.
public void setOption(java.lang.String option,
double value)
setOption(String, String) instead.
No need to override this method.
Override setOption(String, String) instead.
option - The name of the option.value - The desired value.public void setTrain(boolean train)
train - Whether training.
public void processOption(java.lang.String option,
java.lang.String value)
super.processOptions().
option - The name of the option, which is generally
all lowercase.value - The value, which may be the string representation
of a boolean or real value
(In a format supported by by Boolean.parseBoolean or Double.parseDouble)
or any arbitrary string.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||