public class AnnotatedText extends Object
AnnotatedText
is blob of text and its attributes.
The attributes are available from getAttributes()
, as well as from
some convenience accessors, such as getTokens()
or getEntityMentions()
.
012345678901 Hello worldThe token "Hello" has start offset 0 and end offset 5.
Modifier and Type | Class and Description |
---|---|
static class |
AnnotatedText.Builder
Builder class for
AnnotatedText objects. |
Modifier and Type | Method and Description |
---|---|
Map<String,BaseAttribute> |
getAttributes()
Returns all of the annotations on this text.
|
ListAttribute<com.basistech.rosette.dm.BaseNounPhrase> |
getBaseNounPhrases()
Returns the list of base noun phrases.
|
ListAttribute<com.basistech.rosette.dm.CategorizerResult> |
getCategorizerResults()
Returns the list of categorizer results.
|
CharSequence |
getData()
Returns the character data for this text.
|
Map<String,List<String>> |
getDocumentMetadata()
Returns document-level metadata.
|
ListAttribute<com.basistech.rosette.dm.Entity> |
getEntities()
Returns the list of entities.
|
ListAttribute<com.basistech.rosette.dm.EntityMention> |
getEntityMentions()
Deprecated.
this constructs a list of the old objects for compatibility, the supported
item is
Mention . |
ListAttribute<LanguageDetection> |
getLanguageDetectionRegions()
Returns the list of language regions.
|
ListAttribute<com.basistech.rosette.dm.RelationshipMention> |
getRelationshipMentions()
Returns the list of relationship mentions.
|
ListAttribute<com.basistech.rosette.dm.ResolvedEntity> |
getResolvedEntities()
Deprecated.
this constructs a list of the old objects for compatibility, the supported item
is
Entity . |
ListAttribute<ScriptRegion> |
getScriptRegions()
Returns the list of script regions.
|
ListAttribute<com.basistech.rosette.dm.Sentence> |
getSentences()
Returns the list of sentences.
|
ListAttribute<com.basistech.rosette.dm.CategorizerResult> |
getSentimentResults()
Returns the list of sentiment results.
|
ListAttribute<com.basistech.rosette.dm.Token> |
getTokens()
Returns the list of tokens.
|
ListAttribute<com.basistech.rosette.dm.TranslatedData> |
getTranslatedData()
Returns the translations for the text.
|
ListAttribute<com.basistech.rosette.dm.TranslatedTokens> |
getTranslatedTokens()
Returns the translated tokens.
|
LanguageDetection |
getWholeTextLanguageDetection()
Returns the language results for the entire text.
|
String |
toString()
toString is a convenience for accessing the textual data, if any, in this annotated text.
|
public CharSequence getData()
public Map<String,List<String>> getDocumentMetadata()
public Map<String,BaseAttribute> getAttributes()
AttributeKey.key()
. The values
are polymorphic; the subclass of BaseAttribute
depends
on the attribute. Applications should usually prefer to use the
convenience accessors (e.g. getTokens
) instead, to avoid the
need for a cast.
Note that this map will not return EntityMention
or ResolvedEntity
objects,
which are deprecated; they are only available from the specific accessors.public ListAttribute<com.basistech.rosette.dm.Token> getTokens()
public ListAttribute<com.basistech.rosette.dm.TranslatedTokens> getTranslatedTokens()
TranslatedTokens
for Simplified Chinese, and element 1 may contain the TranslatedTokens
for Japanese. Usually only element 0 will be populated.public ListAttribute<com.basistech.rosette.dm.TranslatedData> getTranslatedData()
TranslatedData
for Simplified Chinese, and element 1 may contain the TranslatedData
for Japanese. Usually only element 0 will be populated.public ListAttribute<LanguageDetection> getLanguageDetectionRegions()
public LanguageDetection getWholeTextLanguageDetection()
@Deprecated public ListAttribute<com.basistech.rosette.dm.EntityMention> getEntityMentions()
Mention
.public ListAttribute<com.basistech.rosette.dm.Entity> getEntities()
public ListAttribute<com.basistech.rosette.dm.RelationshipMention> getRelationshipMentions()
@Deprecated public ListAttribute<com.basistech.rosette.dm.ResolvedEntity> getResolvedEntities()
Entity
.public ListAttribute<ScriptRegion> getScriptRegions()
public ListAttribute<com.basistech.rosette.dm.Sentence> getSentences()
public ListAttribute<com.basistech.rosette.dm.BaseNounPhrase> getBaseNounPhrases()
public ListAttribute<com.basistech.rosette.dm.CategorizerResult> getCategorizerResults()
public ListAttribute<com.basistech.rosette.dm.CategorizerResult> getSentimentResults()
public String toString()
toString
in class Object
null
, this returns null
rather than throwing a NullPointerException
.Copyright © 2016 Basis Technology Corporation. All Rights Reserved.