Package com.basistech.rosette.dm
Class LanguageDetection.DetectionResult.Builder
java.lang.Object
com.basistech.rosette.dm.BaseAttribute.Builder<LanguageDetection.DetectionResult,LanguageDetection.DetectionResult.Builder>
com.basistech.rosette.dm.LanguageDetection.DetectionResult.Builder
- Enclosing class:
- LanguageDetection.DetectionResult
public static class LanguageDetection.DetectionResult.Builder
extends BaseAttribute.Builder<LanguageDetection.DetectionResult,LanguageDetection.DetectionResult.Builder>
Builder for detection results.
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a builder initialized from an existing detection result.Builder(com.basistech.util.LanguageCode language) Constructs a builder with default values. -
Method Summary
Modifier and TypeMethodDescriptionbuild()Build an immutable detection result from the current state of the builder.confidence(Double confidence) Specifies the confidence.Specifies the encoding.getThis()language(com.basistech.util.LanguageCode language) Specifies the language.script(com.basistech.util.ISO15924 script) Specifies the script.Methods inherited from class com.basistech.rosette.dm.BaseAttribute.Builder
addAllToList, addAllToSet, buildExtendedProperties, extendedProperties, extendedProperty, nullOrList
-
Constructor Details
-
Builder
public Builder(com.basistech.util.LanguageCode language) Constructs a builder with default values.- Parameters:
language- the detected language
-
Builder
Constructs a builder initialized from an existing detection result.- Parameters:
toCopy- the item to copy
-
-
Method Details
-
language
Specifies the language.- Parameters:
language- the language- Returns:
- this
-
encoding
Specifies the encoding.- Parameters:
encoding- the encoding- Returns:
- this
-
script
Specifies the script.- Parameters:
script- the script- Returns:
- this
-
confidence
Specifies the confidence.- Parameters:
confidence- the confidence; null if no confidence is available.- Returns:
- this.
-
build
Build an immutable detection result from the current state of the builder.- Returns:
- the detection result
-
getThis
- Specified by:
getThisin classBaseAttribute.Builder<LanguageDetection.DetectionResult,LanguageDetection.DetectionResult.Builder>
-