Package opennlp.tools.util

# Interface Parameters

public interface Parameters

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final String`
  `ALGORITHM_DEFAULT_VALUE`
  `static final String`
  `ALGORITHM_PARAM`
  `static final int`
  `CUTOFF_DEFAULT_VALUE`
  The default cut off value is 5.
  `static final String`
  `CUTOFF_PARAM`
  `static final int`
  `ITERATIONS_DEFAULT_VALUE`
  The default number of iterations is 100.
  `static final String`
  `ITERATIONS_PARAM`
  `static final String`
  `THREADS_PARAM`
  `static final String`
  `TRAINER_TYPE_PARAM`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `algorithm()`
  `String`
  `algorithm(String namespace)`
  `boolean`
  `getBooleanParameter(String key, boolean defaultValue)`
  Obtains a training parameter value.
  `boolean`
  `getBooleanParameter(String namespace, String key, boolean defaultValue)`
  Obtains a training parameter value in the specified namespace.
  `double`
  `getDoubleParameter(String key, double defaultValue)`
  Obtains a training parameter value.
  `double`
  `getDoubleParameter(String namespace, String key, double defaultValue)`
  Obtains a training parameter value in the specified namespace.
  `int`
  `getIntParameter(String key, int defaultValue)`
  Obtains a training parameter value.
  `int`
  `getIntParameter(String namespace, String key, int defaultValue)`
  Obtains a training parameter value in the specified namespace.
  `static String`
  `getKey(String namespace, String key)`
  `Map<String,Object>`
  `getObjectSettings()`
  `Map<String,Object>`
  `getObjectSettings(String namespace)`
  `String`
  `getStringParameter(String key, String defaultValue)`
  Obtains a training parameter value.
  `String`
  `getStringParameter(String namespace, String key, String defaultValue)`
  Obtains a training parameter value in the specified namespace.
  `void`
  `put(String key, boolean value)`
  Puts a `value` into the current `Parameters` under a certain `key`.
  `void`
  `put(String key, double value)`
  Puts a `value` into the current `Parameters` under a certain `key`.
  `void`
  `put(String key, int value)`
  Puts a `value` into the current `Parameters` under a certain `key`.
  `void`
  `put(String key, String value)`
  Puts a `value` into the current `Parameters` under a certain `key`.
  `void`
  `put(String namespace, String key, boolean value)`
  Puts a `value` into the current `Parameters` under a certain `key`.
  `void`
  `put(String namespace, String key, double value)`
  Puts a `value` into the current `Parameters` under a certain `key`.
  `void`
  `put(String namespace, String key, int value)`
  Puts a `value` into the current `Parameters` under a certain `key`.
  `void`
  `put(String namespace, String key, String value)`
  Puts a `value` into the current `Parameters` under a certain `key`.
  `void`
  `putIfAbsent(String key, boolean value)`
  Puts a `value` into the current `Parameters` under a certain `key`, if the value was not present before.
  `void`
  `putIfAbsent(String key, double value)`
  Puts a `value` into the current `Parameters` under a certain `key`, if the value was not present before.
  `void`
  `putIfAbsent(String key, int value)`
  Puts a `value` into the current `Parameters` under a certain `key`, if the value was not present before.
  `void`
  `putIfAbsent(String key, String value)`
  Puts a `value` into the current `Parameters` under a certain `key`, if the value was not present before.
  `void`
  `putIfAbsent(String namespace, String key, boolean value)`
  Puts a `value` into the current `Parameters` under a certain `key`, if the value was not present before.
  `void`
  `putIfAbsent(String namespace, String key, double value)`
  Puts a `value` into the current `Parameters` under a certain `key`, if the value was not present before.
  `void`
  `putIfAbsent(String namespace, String key, int value)`
  Puts a `value` into the current `Parameters` under a certain `key`, if the value was not present before.
  `void`
  `putIfAbsent(String namespace, String key, String value)`
  Puts a `value` into the current `Parameters` under a certain `key`, if the value was not present before.
  `void`
  `serialize(OutputStream out)`
  Serializes a `Parameters` instance via a specified `OutputStream`.

- ## Field Details

  - ### ALGORITHM_PARAM

    static final String ALGORITHM_PARAM
    See Also:
      - Constant Field Values

  - ### TRAINER_TYPE_PARAM

    static final String TRAINER_TYPE_PARAM
    See Also:
      - Constant Field Values

  - ### ITERATIONS_PARAM

    static final String ITERATIONS_PARAM
    See Also:
      - Constant Field Values

  - ### CUTOFF_PARAM

    static final String CUTOFF_PARAM
    See Also:
      - Constant Field Values

  - ### THREADS_PARAM

    static final String THREADS_PARAM
    See Also:
      - Constant Field Values

  - ### ALGORITHM_DEFAULT_VALUE

    static final String ALGORITHM_DEFAULT_VALUE

  - ### ITERATIONS_DEFAULT_VALUE

    static final int ITERATIONS_DEFAULT_VALUE
    The default number of iterations is 100.
    See Also:
      - Constant Field Values

  - ### CUTOFF_DEFAULT_VALUE

    static final int CUTOFF_DEFAULT_VALUE
    The default cut off value is 5.
    See Also:
      - Constant Field Values

- ## Method Details

  - ### getKey

    static String getKey(String namespace, String key)
    Parameters:
      `namespace` - The namespace used as prefix or `null`. If `null` the `key` is left unchanged.
      `key` - The identifying key to process.
    Returns:
      Retrieves a prefixed key in the specified `namespace`. If no `namespace` was specified the returned String is equal to `key`.

  - ### algorithm

    String algorithm(String namespace)
    Returns:
      Retrieves the (training) algorithm name for a given name space, or `null` if unset.

  - ### algorithm

    String algorithm()
    Returns:
      Retrieves the (training) algorithm name. or @code null} if not set.

  - ### getObjectSettings

    Map<String,Object> getObjectSettings(String namespace)
    Parameters:
      `namespace` - The name space to filter or narrow the search space. May be `null`.
    Returns:
      Retrieves a parameter `Map` which can be passed to the train and validate methods.

  - ### getObjectSettings

    Map<String,Object> getObjectSettings()
    Returns:
      Retrieves a parameter `Map` of all parameters without narrowing.

  - ### putIfAbsent

    void putIfAbsent(String namespace, String key, String value)
    Puts a `value` into the current `Parameters` under a certain `key`, if the value was not present before. The `namespace` can be used to prefix the `key`.
    Parameters:
      `namespace` - A prefix to declare or use a name space under which `key` shall be put. May be `null`.
      `key` - The identifying key to put or retrieve a `value` with.
      `value` - The `String` parameter to put into this `Parameters` instance.

  - ### putIfAbsent

    void putIfAbsent(String key, String value)
    Puts a `value` into the current `Parameters` under a certain `key`, if the value was not present before.
    Parameters:
      `key` - The identifying key to put or retrieve a `value` with.
      `value` - The `String` parameter to put into this `Parameters` instance.

  - ### putIfAbsent

    void putIfAbsent(String namespace, String key, int value)
    Puts a `value` into the current `Parameters` under a certain `key`, if the value was not present before. The `namespace` can be used to prefix the `key`.
    Parameters:
      `namespace` - A prefix to declare or use a name space under which `key` shall be put. May be `null`.
      `key` - The identifying key to put or retrieve a `value` with.
      `value` - The `Integer` parameter to put into this `Parameters` instance.

  - ### putIfAbsent

    void putIfAbsent(String key, int value)
    Puts a `value` into the current `Parameters` under a certain `key`, if the value was not present before.
    Parameters:
      `key` - The identifying key to put or retrieve a `value` with.
      `value` - The `Integer` parameter to put into this `Parameters` instance.

  - ### putIfAbsent

    void putIfAbsent(String namespace, String key, double value)
    Puts a `value` into the current `Parameters` under a certain `key`, if the value was not present before. The `namespace` can be used to prefix the `key`.
    Parameters:
      `namespace` - A prefix to declare or use a name space under which `key` shall be put. May be `null`.
      `key` - The identifying key to put or retrieve a `value` with.
      `value` - The `Double` parameter to put into this `Parameters` instance.

  - ### putIfAbsent

    void putIfAbsent(String key, double value)
    Puts a `value` into the current `Parameters` under a certain `key`, if the value was not present before. The `namespace` can be used to prefix the `key`.
    Parameters:
      `key` - The identifying key to put or retrieve a `value` with.
      `value` - The `Double` parameter to put into this `Parameters` instance.

  - ### putIfAbsent

    void putIfAbsent(String namespace, String key, boolean value)
    Puts a `value` into the current `Parameters` under a certain `key`, if the value was not present before. The `namespace` can be used to prefix the `key`.
    Parameters:
      `namespace` - A prefix to declare or use a name space under which `key` shall be put. May be `null`.
      `key` - The identifying key to put or retrieve a `value` with.
      `value` - The `Boolean` parameter to put into this `Parameters` instance.

  - ### putIfAbsent

    void putIfAbsent(String key, boolean value)
    Puts a `value` into the current `Parameters` under a certain `key`, if the value was not present before.
    Parameters:
      `key` - The identifying key to put or retrieve a `value` with.
      `value` - The `Boolean` parameter to put into this `Parameters` instance.

  - ### put

    void put(String namespace, String key, String value)
    Puts a `value` into the current `Parameters` under a certain `key`. If the value was present before, the previous value will be overwritten with the specified one. The `namespace` can be used to prefix the `key`.
    Parameters:
      `namespace` - A prefix to declare or use a name space under which `key` shall be put. May be `null`.
      `key` - The identifying key to put or retrieve a `value` with.
      `value` - The `String` parameter to put into this `Parameters` instance.

  - ### put

    void put(String key, String value)
    Puts a `value` into the current `Parameters` under a certain `key`. If the value was present before, the previous value will be overwritten with the specified one.
    Parameters:
      `key` - The identifying key to put or retrieve a `value` with.
      `value` - The `String` parameter to put into this `Parameters` instance.

  - ### put

    void put(String namespace, String key, int value)
    Puts a `value` into the current `Parameters` under a certain `key`. If the value was present before, the previous value will be overwritten with the specified one. The `namespace` can be used to prefix the `key`.
    Parameters:
      `namespace` - A prefix to declare or use a name space under which `key` shall be put. May be `null`.
      `key` - The identifying key to put or retrieve a `value` with.
      `value` - The `Integer` parameter to put into this `Parameters` instance.

  - ### put

    void put(String key, int value)
    Puts a `value` into the current `Parameters` under a certain `key`. If the value was present before, the previous value will be overwritten with the specified one.
    Parameters:
      `key` - The identifying key to put or retrieve a `value` with.
      `value` - The `Integer` parameter to put into this `Parameters` instance.

  - ### put

    void put(String namespace, String key, double value)
    Puts a `value` into the current `Parameters` under a certain `key`. If the value was present before, the previous value will be overwritten with the specified one. The `namespace` can be used to prefix the `key`.
    Parameters:
      `namespace` - A prefix to declare or use a name space under which `key` shall be put. May be `null`.
      `key` - The identifying key to put or retrieve a `value` with.
      `value` - The `Double` parameter to put into this `Parameters` instance.

  - ### put

    void put(String key, double value)
    Puts a `value` into the current `Parameters` under a certain `key`. If the value was present before, the previous value will be overwritten with the specified one.
    Parameters:
      `key` - The identifying key to put or retrieve a `value` with.
      `value` - The `Double` parameter to put into this `Parameters` instance.

  - ### put

    void put(String namespace, String key, boolean value)
    Puts a `value` into the current `Parameters` under a certain `key`. If the value was present before, the previous value will be overwritten with the specified one. The `namespace` can be used to prefix the `key`.
    Parameters:
      `namespace` - A prefix to declare or use a name space under which `key` shall be put. May be `null`.
      `key` - The identifying key to put or retrieve a `value` with.
      `value` - The `Boolean` parameter to put into this `Parameters` instance.

  - ### put

    void put(String key, boolean value)
    Puts a `value` into the current `Parameters` under a certain `key`. If the value was present before, the previous value will be overwritten with the specified one.
    Parameters:
      `key` - The identifying key to put or retrieve a `value` with.
      `value` - The `Boolean` parameter to put into this `Parameters` instance.

  - ### serialize

    void serialize(OutputStream out) throws IOException
    Serializes a `Parameters` instance via a specified `OutputStream`.
    Parameters:
      `out` - A valid, open `OutputStream` to write to.
    Throws:
      `IOException` - Thrown if errors occurred.

  - ### getStringParameter

    String getStringParameter(String key, String defaultValue)
    Obtains a training parameter value.
    Parameters:
      `key` - The identifying key to retrieve a `value` with.
      `defaultValue` - The alternative value to use, if `key` was not present.
    Returns:
      The `training value` associated with `key` if present, or a `defaultValue` if not.
    Throws:
      `ClassCastException` - } Thrown if the value is not `String`

  - ### getStringParameter

    String getStringParameter(String namespace, String key, String defaultValue)
    Obtains a training parameter value in the specified namespace.
    Parameters:
      `namespace` - A prefix to declare or use a name space under which `key` shall be searched. May be `null`.
      `key` - The identifying key to retrieve a `value` with.
      `defaultValue` - The alternative value to use, if `key` was not present.
    Returns:
      The `training value` associated with `key` if present, or a `defaultValue` if not.
    Throws:
      `ClassCastException` - } Thrown if the value is not `String`

  - ### getIntParameter

    int getIntParameter(String key, int defaultValue)
    Obtains a training parameter value.

    Parameters:
      `key` - The identifying key to retrieve a `value` with.
      `defaultValue` - The alternative value to use, if `key` was not present.
    Returns:
      The `training value` associated with `key` if present, or a `defaultValue` if not.

  - ### getIntParameter

    int getIntParameter(String namespace, String key, int defaultValue)
    Obtains a training parameter value in the specified namespace.

    Parameters:
      `namespace` - A prefix to declare or use a name space under which `key` shall be searched. May be `null`.
      `key` - The identifying key to retrieve a `value` with.
      `defaultValue` - The alternative value to use, if `key` was not present.
    Returns:
      The `training value` associated with `key` if present, or a `defaultValue` if not.

  - ### getDoubleParameter

    double getDoubleParameter(String key, double defaultValue)
    Obtains a training parameter value.

    Parameters:
      `key` - The identifying key to retrieve a `value` with.
      `defaultValue` - The alternative value to use, if `key` was not present.
    Returns:
      The `training value` associated with `key` if present, or a `defaultValue` if not.

  - ### getDoubleParameter

    double getDoubleParameter(String namespace, String key, double defaultValue)
    Obtains a training parameter value in the specified namespace.

    Parameters:
      `namespace` - A prefix to declare or use a name space under which `key` shall be searched. May be `null`.
      `key` - The identifying key to retrieve a `value` with.
      `defaultValue` - The alternative value to use, if `key` was not present.
    Returns:
      The `training value` associated with `key` if present, or a `defaultValue` if not.

  - ### getBooleanParameter

    boolean getBooleanParameter(String key, boolean defaultValue)
    Obtains a training parameter value.

    Parameters:
      `key` - The identifying key to retrieve a `value` with.
      `defaultValue` - The alternative value to use, if `key` was not present.
    Returns:
      The `training value` associated with `key` if present, or a `defaultValue` if not.

  - ### getBooleanParameter

    boolean getBooleanParameter(String namespace, String key, boolean defaultValue)
    Obtains a training parameter value in the specified namespace.

    Parameters:
      `namespace` - A prefix to declare or use a name space under which `key` shall be searched. May be `null`.
      `key` - The identifying key to retrieve a `value` with.
      `defaultValue` - The alternative value to use, if `key` was not present.
    Returns:
      The `training value` associated with `key` if present, or a `defaultValue` if not.