Class RetokenizeConfiguration.Builder

java.lang.Object
org.coordinatekit.crf.annotator.RetokenizeConfiguration.Builder
Enclosing class:
RetokenizeConfiguration

public static final class RetokenizeConfiguration.Builder extends Object
Builder for constructing RetokenizeConfiguration instances.

input(Path) and output(Path) are required; the model is optional and the threshold defaults to RetokenizeConfiguration.DEFAULT_THRESHOLD.

  • Method Details

    • build

      public RetokenizeConfiguration build()
      Builds the configuration with the current settings.
      Returns:
      an immutable configuration instance
      Throws:
      IllegalStateException - if the input or output path was not set
    • input

      public RetokenizeConfiguration.Builder input(Path input)
      Sets the path to the XML training-data file to review.
      Parameters:
      input - the input file path
      Returns:
      this builder
    • model

      Sets the path to a serialized model. Optional; if absent re-tagging runs without tag suggestions.
      Parameters:
      model - the model path, or null if no model is supplied
      Returns:
      this builder
    • output

      public RetokenizeConfiguration.Builder output(Path output)
      Sets the path to the XML output file; must be absent or empty, and must differ from the input.
      Parameters:
      output - the output file path
      Returns:
      this builder
    • threshold

      public RetokenizeConfiguration.Builder threshold(double threshold)
      Sets the confidence threshold below which token rows are highlighted.
      Parameters:
      threshold - the threshold, in the closed interval [0.0, 1.0]
      Returns:
      this builder
      Throws:
      IllegalArgumentException - if the threshold is NaN or outside [0.0, 1.0]