Class AnnotatorConfiguration.Builder

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

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

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

  • Method Details

    • build

      public AnnotatorConfiguration 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 AnnotatorConfiguration.Builder input(Path input)
      Sets the path to the plain-text input file (UTF-8), one sequence per line.
      Parameters:
      input - the input file path
      Returns:
      this builder
    • model

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

      public AnnotatorConfiguration.Builder output(Path output)
      Sets the path to the XML output file; created or appended.
      Parameters:
      output - the output file path
      Returns:
      this builder
    • threshold

      public AnnotatorConfiguration.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]