Class PhoneticEngine.Builder

java.lang.Object
org.apache.commons.codec.language.bm.PhoneticEngine.Builder
All Implemented Interfaces:
Supplier<PhoneticEngine>
Enclosing class:
PhoneticEngine

public static class PhoneticEngine.Builder extends Object implements Supplier<PhoneticEngine>
Builder for a PhoneticEngine.
Since:
1.23.0
  • Method Details

    • get

      public PhoneticEngine get()
      Specified by:
      get in interface Supplier<PhoneticEngine>
    • setAll

      Sets all the properties of this builder to match those of the given engine.
      Parameters:
      engine - The engine to copy properties from.
      Returns:
      This builder.
    • setConcat

      public PhoneticEngine.Builder setConcat(boolean concat)
      Sets whether the engine will concatenate multiple encodings.
      Parameters:
      concat - Whether the engine will concatenate multiple encodings.
      Returns:
      This builder.
    • setMaxInputLength

      public PhoneticEngine.Builder setMaxInputLength(int maxInputLength)
      Sets the maximum input length allowed.

      A value less than 0 will reset the maximum input length to the default value of 666, see Hubert Blaine Wolfeschlegelsteinhausenbergerdorff Sr..

      Parameters:
      maxInputLength - the maximum input length allowed.
      Returns:
      This builder.
    • setMaxPhonemes

      public PhoneticEngine.Builder setMaxPhonemes(int maxPhonemes)
      Sets maximum number of phonemes the engine will handle.

      A value less than 0 will reset the maximum number of phonemes to the default 20.

      Parameters:
      maxPhonemes - The maximum number of phonemes the engine will handle.
      Returns:
      This builder.
    • setNameType

      Sets the name type for the engine to be built.

      A null value will reset the name type to the default of NameType.GENERIC.

      Parameters:
      nameType - The type of names the engine will use.
      Returns:
      This builder.
    • setRuleType

      Sets the rule type for the engine to be built.

      A null value will reset the rule type to the default of RuleType.APPROX.

      Parameters:
      ruleType - The type of rules the engine will use.
      Returns:
      This builder.