Class PhoneticEngine.Builder
- java.lang.Object
-
- org.apache.commons.codec.language.bm.PhoneticEngine.Builder
-
- All Implemented Interfaces:
java.util.function.Supplier<PhoneticEngine>
- Enclosing class:
- PhoneticEngine
public static class PhoneticEngine.Builder extends java.lang.Object implements java.util.function.Supplier<PhoneticEngine>
Builder for a PhoneticEngine.- Since:
- 1.23.0
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PhoneticEngineget()PhoneticEngine.BuildersetAll(PhoneticEngine engine)Sets all the properties of this builder to match those of the given engine.PhoneticEngine.BuildersetConcat(boolean concat)Sets whether the engine will concatenate multiple encodings.PhoneticEngine.BuildersetMaxInputLength(int maxInputLength)Sets the maximum input length allowed.PhoneticEngine.BuildersetMaxPhonemes(int maxPhonemes)Sets maximum number of phonemes the engine will handle.PhoneticEngine.BuildersetNameType(NameType nameType)Sets the name type for the engine to be built.PhoneticEngine.BuildersetRuleType(RuleType ruleType)Sets the rule type for the engine to be built.
-
-
-
Method Detail
-
get
public PhoneticEngine get()
- Specified by:
getin interfacejava.util.function.Supplier<PhoneticEngine>
-
setAll
public PhoneticEngine.Builder setAll(PhoneticEngine engine)
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
public PhoneticEngine.Builder setNameType(NameType nameType)
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
public PhoneticEngine.Builder setRuleType(RuleType ruleType)
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.
-
-