Package opennlp.tools.util
Class TrainingParameters
java.lang.Object
opennlp.tools.util.TrainingParameters
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionTrainingParameters
(Map<String, String> map) Deprecated.TrainingParameters
(TrainingParameters trainingParameters) -
Method Summary
Modifier and TypeMethodDescriptionRetrieves the training algorithm name.Retrieves the training algorithm name for a given name space.static TrainingParameters
boolean
getBooleanParameter
(String key, boolean defaultValue) get a Boolean parameterboolean
getBooleanParameter
(String namespace, String key, boolean defaultValue) get a Boolean parameter in the specified namespacedouble
getDoubleParameter
(String key, double defaultValue) get a Double parameterdouble
getDoubleParameter
(String namespace, String key, double defaultValue) get a Double parameter in the specified namespaceint
getIntParameter
(String key, int defaultValue) get an Integer parameterint
getIntParameter
(String namespace, String key, int defaultValue) get an Integer parameter in the specified namespaceRetrieves all parameters without a name space.getObjectSettings
(String namespace) Retrieves a map with the training parameters which have the passed name space.getParameters
(String namespace) Deprecated.getSettings
(String namespace) Deprecated.usegetObjectSettings(String)
insteadgetStringParameter
(String key, String defaultValue) get a String parameter.getStringParameter
(String namespace, String key, String defaultValue) get a String parameter in the specified namespace.void
void
void
void
void
void
void
void
void
putIfAbsent
(String key, boolean value) void
putIfAbsent
(String key, double value) void
putIfAbsent
(String key, int value) void
putIfAbsent
(String key, String value) void
putIfAbsent
(String namespace, String key, boolean value) void
putIfAbsent
(String namespace, String key, double value) void
putIfAbsent
(String namespace, String key, int value) void
putIfAbsent
(String namespace, String key, String value) void
serialize
(OutputStream out)
-
Field Details
-
ALGORITHM_PARAM
- See Also:
-
TRAINER_TYPE_PARAM
- See Also:
-
ITERATIONS_PARAM
- See Also:
-
CUTOFF_PARAM
- See Also:
-
THREADS_PARAM
- See Also:
-
-
Constructor Details
-
TrainingParameters
public TrainingParameters() -
TrainingParameters
-
TrainingParameters
Deprecated. -
TrainingParameters
- Throws:
IOException
-
-
Method Details
-
algorithm
Retrieves the training algorithm name for a given name space.- Returns:
- the name or null if not set.
-
algorithm
Retrieves the training algorithm name.- Returns:
- the name or null if not set.
-
getSettings
Deprecated.usegetObjectSettings(String)
insteadRetrieves a map with the training parameters which have the passed name space.- Parameters:
namespace
-- Returns:
- a parameter map which can be passed to the train and validate methods.
-
getSettings
Deprecated.usegetObjectSettings()
insteadRetrieves all parameters without a name space.- Returns:
- the settings map
-
getObjectSettings
Retrieves a map with the training parameters which have the passed name space.- Parameters:
namespace
-- Returns:
- a parameter map which can be passed to the train and validate methods.
-
getObjectSettings
Retrieves all parameters without a name space.- Returns:
- the settings map
-
getParameters
-
putIfAbsent
-
putIfAbsent
-
putIfAbsent
-
putIfAbsent
-
putIfAbsent
-
putIfAbsent
-
putIfAbsent
-
putIfAbsent
-
put
-
put
-
put
-
put
-
put
-
put
-
put
-
put
-
serialize
- Throws:
IOException
-
getStringParameter
get a String parameter.ClassCastException
can be thrown if the value is notString
- Parameters:
key
-defaultValue
-- Returns:
-
getStringParameter
get a String parameter in the specified namespace.ClassCastException
can be thrown if the value is notString
- Parameters:
namespace
-key
-defaultValue
-- Returns:
-
getIntParameter
get an Integer parameter- Parameters:
key
-defaultValue
-- Returns:
-
getIntParameter
get an Integer parameter in the specified namespace- Parameters:
namespace
-key
-defaultValue
-- Returns:
-
getDoubleParameter
get a Double parameter- Parameters:
key
-defaultValue
-- Returns:
-
getDoubleParameter
get a Double parameter in the specified namespace- Parameters:
namespace
-key
-defaultValue
-- Returns:
-
getBooleanParameter
get a Boolean parameter- Parameters:
key
-defaultValue
-- Returns:
-
getBooleanParameter
get a Boolean parameter in the specified namespace- Parameters:
namespace
-key
-defaultValue
-- Returns:
-
defaultParams
-
getObjectSettings()
instead