Package com.basistech.rosette.dm
Class BaseNounPhrase.Builder
java.lang.Object
com.basistech.rosette.dm.BaseAttribute.Builder<Attribute,Attribute.Builder<T,B>>
com.basistech.rosette.dm.Attribute.Builder<BaseNounPhrase,BaseNounPhrase.Builder>
com.basistech.rosette.dm.BaseNounPhrase.Builder
- Enclosing class:
- BaseNounPhrase
public static class BaseNounPhrase.Builder
extends Attribute.Builder<BaseNounPhrase,BaseNounPhrase.Builder>
Builder for base noun phrase attributes.
-
Field Summary
Fields inherited from class com.basistech.rosette.dm.Attribute.Builder
endOffset, startOffset
-
Constructor Summary
ConstructorsConstructorDescriptionBuilder
(int[] tokenOffsets, int tokenStartIndex, int tokenEndIndex) Constructs a builder from the 'traditional Rosette' data structure.Builder
(int startOffset, int endOffset) Constructs a builder from the required properties.Builder
(BaseNounPhrase toCopy) Constructs a builder from an existing BaseNounPhrase. -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Constructs the base noun phrase from the current state of the builder.protected BaseNounPhrase.Builder
getThis()
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
public Builder(int startOffset, int endOffset) Constructs a builder from the required properties.- Parameters:
startOffset
- start offset in charactersendOffset
- end offset in characters
-
Builder
public Builder(int[] tokenOffsets, int tokenStartIndex, int tokenEndIndex) Constructs a builder from the 'traditional Rosette' data structure. That data structure is an int[] in which the even-numbered items are token start offsets, and the odd-numbered items are token end offsets.- Parameters:
tokenOffsets
- array of token start/end offsetstokenStartIndex
- index in tokenOffsets for the start of the phrasetokenEndIndex
- index in tokenOffsets for the end of the phrase
-
Builder
Constructs a builder from an existing BaseNounPhrase.- Parameters:
toCopy
- the object to copy
-
-
Method Details
-
build
Constructs the base noun phrase from the current state of the builder.- Returns:
- the new analysis object
-
getThis
- Specified by:
getThis
in classAttribute.Builder<BaseNounPhrase,
BaseNounPhrase.Builder>
-