Package com.basistech.rosette.dm
Class AnnotatedText.Builder
java.lang.Object
com.basistech.rosette.dm.AnnotatedText.Builder
- Enclosing class:
- AnnotatedText
Builder class for
AnnotatedText objects.-
Constructor Summary
ConstructorsConstructorDescriptionBuilder()Constructs a builder.Builder(AnnotatedText startingPoint) Constructs a builder from an existingAnnotatedText. -
Method Summary
Modifier and TypeMethodDescriptionReturns the current attributes.baseNounPhrases(ListAttribute<BaseNounPhrase> baseNounPhrases) Attaches a list of base noun phrases.build()Constructs aAnnotatedTextobject from the settings in this builder.categorizerResults(ListAttribute<CategorizerResult> categorizerResults) Attaches a list of categorizer results.concepts(ListAttribute<Concept> concepts) data()Returns the current character data.data(CharSequence data) Constructs a builder over some character data.dependencies(ListAttribute<Dependency> dependencies) Attaches a list of dependencies.Returns the current document metadata.documentMetadata(String key, String value) Adds an entry to the document metadata.documentMetadata(String key, List<String> value) Adds an entry to the document metadata.documentMetadata(Map<String, List<String>> mapOfValues) Add all of the contents of a map of metadata to the document metadata.embeddings(Embeddings embeddings) Attaches a set of embeddings.entities(ListAttribute<Entity> entities) Attaches a list of entities.entityMentions(ListAttribute<EntityMention> entityMentions) Deprecated.events(ListAttribute<Event> events) Attaches a list of events.keyphrases(ListAttribute<Keyphrase> keyphrases) languageDetectionRegions(ListAttribute<LanguageDetection> languageDetectionRegions) Attaches a list of language detections.layoutRegions(ListAttribute<LayoutRegion> layoutRegions) Attaches a list of layout regions.relationshipMentions(ListAttribute<RelationshipMention> relationshipMentions) Attaches a list of relationship mentions.resolvedEntities(ListAttribute<ResolvedEntity> resolvedEntities) Deprecated.scriptRegions(ListAttribute<ScriptRegion> scriptRegions) Attaches a list of script regions.sentences(ListAttribute<Sentence> sentences) Attaches a list of sentences.sentimentResults(ListAttribute<CategorizerResult> sentimentResults) Attaches a list of sentiment results.similarTerms(MapAttribute<com.basistech.util.LanguageCode, ListAttribute<SimilarTerm>> similarTerms) Attaches a per-language map of similar terms.tokens(ListAttribute<Token> tokens) Attaches a list of tokens.topicResults(ListAttribute<CategorizerResult> topicResults) translatedData(ListAttribute<TranslatedData> translatedData) Attaches a TranslatedData object.translatedTokens(ListAttribute<TranslatedTokens> translatedTokens) Attaches a list of TranslatedTokens objects.transliteration(TransliterationResults transliterationResults) wholeDocumentLanguageDetection(LanguageDetection languageDetection) Attaches a whole-document language detection.
-
Constructor Details
-
Builder
public Builder()Constructs a builder. The initial data is the empty string. -
Builder
Constructs a builder from an existingAnnotatedText.- Parameters:
startingPoint- source object to copy
-
-
Method Details
-
data
Constructs a builder over some character data.- Parameters:
data- the data. This replaces and previous setting.- Returns:
- this
-
data
Returns the current character data.- Returns:
- the current character data
-
baseNounPhrases
Attaches a list of base noun phrases.- Parameters:
baseNounPhrases- the base noun phrases- Returns:
- this
-
entityMentions
@Deprecated public AnnotatedText.Builder entityMentions(ListAttribute<EntityMention> entityMentions) Deprecated.Attaches a list of entity mentions.- Parameters:
entityMentions- the entity mentions- Returns:
- this
-
similarTerms
public AnnotatedText.Builder similarTerms(MapAttribute<com.basistech.util.LanguageCode, ListAttribute<SimilarTerm>> similarTerms) Attaches a per-language map of similar terms.- Parameters:
similarTerms- the similar terms- Returns:
- this
-
relationshipMentions
public AnnotatedText.Builder relationshipMentions(ListAttribute<RelationshipMention> relationshipMentions) Attaches a list of relationship mentions.- Parameters:
relationshipMentions- the relationship mentions.- Returns:
- this
-
entities
Attaches a list of entities.- Parameters:
entities- the entities.- Returns:
- this.
-
resolvedEntities
@Deprecated public AnnotatedText.Builder resolvedEntities(ListAttribute<ResolvedEntity> resolvedEntities) Deprecated.Attaches a list of resolved entities.- Parameters:
resolvedEntities- the resolved entities- Returns:
- this
-
events
Attaches a list of events.- Parameters:
events- events- Returns:
- this
-
languageDetectionRegions
public AnnotatedText.Builder languageDetectionRegions(ListAttribute<LanguageDetection> languageDetectionRegions) Attaches a list of language detections.- Parameters:
languageDetectionRegions- the language detections- Returns:
- this
-
wholeDocumentLanguageDetection
Attaches a whole-document language detection.- Parameters:
languageDetection- the language detection- Returns:
- this
-
scriptRegions
Attaches a list of script regions.- Parameters:
scriptRegions- the script regions- Returns:
- this
-
sentences
Attaches a list of sentences.- Parameters:
sentences- the sentences- Returns:
- this
-
layoutRegions
Attaches a list of layout regions.- Parameters:
layoutRegions- the layout regions- Returns:
- this
-
tokens
Attaches a list of tokens.- Parameters:
tokens- the tokens- Returns:
- this
-
translatedTokens
Attaches a list of TranslatedTokens objects.- Parameters:
translatedTokens- a list of TranslatedTokens objects- Returns:
- this
-
translatedData
Attaches a TranslatedData object.- Parameters:
translatedData- a TranslatedData object- Returns:
- this
-
categorizerResults
public AnnotatedText.Builder categorizerResults(ListAttribute<CategorizerResult> categorizerResults) Attaches a list of categorizer results.- Parameters:
categorizerResults- the categorizer results- Returns:
- this
-
sentimentResults
Attaches a list of sentiment results.- Parameters:
sentimentResults- the sentiment results- Returns:
- this
-
dependencies
Attaches a list of dependencies.- Parameters:
dependencies- the dependencies.- Returns:
- this
-
topicResults
-
embeddings
Attaches a set of embeddings.- Parameters:
embeddings- the embeddings.- Returns:
- this.
-
concepts
-
keyphrases
-
transliteration
-
attributes
Returns the current attributes.- Returns:
- the current attributes
-
documentMetadata
Adds an entry to the document metadata. Replaces any previous value for this key.- Parameters:
key- keyvalue- value- Returns:
- this
-
documentMetadata
Add all of the contents of a map of metadata to the document metadata.- Parameters:
mapOfValues- a map from keys to values.- Returns:
- this
-
documentMetadata
Adds an entry to the document metadata. Replaces any previous value for this key.- Parameters:
key- keyvalue- A single string value. The result of this call is to store a list containing this value as the value for this key.- Returns:
- this
-
documentMetadata
Returns the current document metadata.- Returns:
- the current document metadata
-
build
Constructs aAnnotatedTextobject from the settings in this builder.- Returns:
- the new object
-
entities(ListAttribute).