Package com.basistech.rosette.dm
Class Token.Builder
java.lang.Object
com.basistech.rosette.dm.BaseAttribute.Builder<Attribute,Attribute.Builder<T,B>>
com.basistech.rosette.dm.Attribute.Builder<Token,Token.Builder>
com.basistech.rosette.dm.Token.Builder
- Enclosing class:
- Token
Builder for tokens.
-
Field Summary
Fields inherited from class com.basistech.rosette.dm.Attribute.Builder
endOffset, startOffset
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddAnalysis
(MorphoAnalysis analysis) Adds an analysis.addNormalized
(String normalized) Adds a normalized form.analyses
(List<MorphoAnalysis> analyses) Sets the list of morphological analyses.build()
Creates a new immutable Token object from the current state of the builder.protected Token.Builder
getThis()
normalized
(List<String> normalized) Sets the list of normalized forms.Specifies the source of this token.Specifies the text.Methods inherited from class com.basistech.rosette.dm.Attribute.Builder
endOffset, setEndOffset, startOffset
Methods inherited from class com.basistech.rosette.dm.BaseAttribute.Builder
addAllToList, addAllToSet, buildExtendedProperties, extendedProperties, extendedProperty, nullOrList
-
Constructor Details
-
Builder
Constructs a builder from the required properties.- Parameters:
startOffset
- the start offset in charactersendOffset
- the end offset in characterstext
- the text of the token
-
Builder
Constructs a builder from the values of an existing token.- Parameters:
toCopy
- existing token to copy
-
-
Method Details
-
text
Specifies the text.- Parameters:
text
- the text- Returns:
- this
-
addNormalized
Adds a normalized form.- Parameters:
normalized
- the normalized form- Returns:
- this
-
normalized
Sets the list of normalized forms.- Parameters:
normalized
- the normalized token forms.- Returns:
- this.
-
source
Specifies the source of this token.- Parameters:
source
- the source- Returns:
- this
-
addAnalysis
Adds an analysis.- Parameters:
analysis
- the analysis- Returns:
- this
-
analyses
Sets the list of morphological analyses.- Parameters:
analyses
- the analyses.- Returns:
- this.
-
build
Creates a new immutable Token object from the current state of the builder.- Returns:
- the new token
-
getThis
- Specified by:
getThis
in classAttribute.Builder<Token,
Token.Builder>
-