Class PatchCommandEncoder.Builder

java.lang.Object
org.egothor.stemmer.PatchCommandEncoder.Builder
Enclosing class:
PatchCommandEncoder

public static final class PatchCommandEncoder.Builder extends Object
Fluent builder for creating direction-specialized PatchCommandEncoder instances.
  • Constructor Details

    • Builder

      public Builder()
      Creates a builder initialized with the default Egothor-compatible cost model and backward traversal.
  • Method Details

    • traversalDirection

      public PatchCommandEncoder.Builder traversalDirection(WordTraversalDirection value)
      Sets traversal direction used by the created encoder.
      Parameters:
      value - traversal direction
      Returns:
      this builder
    • insertCost

      public PatchCommandEncoder.Builder insertCost(int value)
      Sets cost of an insert operation.
      Parameters:
      value - cost of the operation
      Returns:
      this builder
    • deleteCost

      public PatchCommandEncoder.Builder deleteCost(int value)
      Sets cost of a delete operation.
      Parameters:
      value - cost of the operation
      Returns:
      this builder
    • replaceCost

      public PatchCommandEncoder.Builder replaceCost(int value)
      Sets cost of a replace operation.
      Parameters:
      value - cost of the operation
      Returns:
      this builder
    • matchCost

      public PatchCommandEncoder.Builder matchCost(int value)
      Sets cost of a match operation.
      Parameters:
      value - cost of the operation
      Returns:
      this builder
    • build

      public PatchCommandEncoder build()
      Builds a direction-specialized encoder instance.
      Returns:
      configured encoder