public class Entity extends Object implements Serializable
| Constructor and Description |
|---|
Entity()
Create a new entity.
|
Entity(Entity entity)
Create a new entity from an existing entity.
|
Entity(String text)
Create a new entity given the attributes of the entity.
|
Entity(String text,
double confidence,
String type,
Span span,
String languageCode)
Create a new entity given the attributes of the entity.
|
Entity(String text,
double confidence,
String type,
String languageCode)
Create a new entity given the attributes of the entity.
|
Entity(String text,
String type)
Create a new entity given the attributes of the entity.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
double |
getConfidence()
Gets the confidence the entity actually is an entity.
|
String |
getContext()
Gets the context of the entity.
|
String |
getDocumentId()
Gets the document ID of the entity.
|
long |
getExtractionDate()
Gets the extraction date.
|
String |
getLanguageCode()
Gets the language code of the entity.
|
Map<String,String> |
getMetadata()
Gets the entity metadata.
|
Span |
getSpan()
Gets the entity
Span in the text. |
String |
getText()
Gets the text of the entity.
|
String |
getType()
Gets the type of the entity.
|
String |
getUri()
Gets the URI of the entity.
|
int |
hashCode() |
void |
setConfidence(double confidence)
Sets the confidence the entity actually is an entity.
|
void |
setContext(String context)
Sets the context of the entity.
|
void |
setDocumentId(String documentId)
Sets the document ID of the entity.
|
void |
setExtractionDate(long extractionDate)
Sets the extraction date.
|
void |
setLanguageCode(String languageCode)
Sets the language code for the entity.
|
void |
setMetadata(Map<String,String> metadata)
Sets the entity metadata.
|
void |
setSpan(Span span)
Sets the entity
Span in the text. |
void |
setText(String text)
Sets the text of the entity.
|
void |
setType(String type)
Sets the type of the entity.
|
void |
setUri(String uri)
Sets the URI of the entity.
|
String |
toString() |
public Entity()
public Entity(Entity entity)
entity - An existing entity.public Entity(String text, double confidence, String type, String languageCode)
text - The text of the entity.confidence - The confidence the text as determined during the extraction. This will be a decimal value between 0 and 100. A higher value indicates a higher level of confidence.type - The type of entity.languageCode - The two-letter ISO language code of the entity.public Entity(String text, double confidence, String type, Span span, String languageCode)
text - The text of the entity.confidence - The confidence the text as determined during the extraction. This will be a decimal value between 0 and 100. A higher value indicates a higher level of confidence.span - The location of the entity in the text.type - The type of entity.languageCode - The two-letter ISO language code of the entity.public Entity(String text)
text - The text of the entity.public String getText()
public void setText(String text)
text - The text of the entity.public double getConfidence()
public void setConfidence(double confidence)
confidence - The confidence of the entity. This should be a value between 0 and 100.public String getUri()
public void setUri(String uri)
uri - The entity URI.public Span getSpan()
Span in the text.Span in the text.public void setSpan(Span span)
Span in the text.span - The entity Span in the text.public String getLanguageCode()
public void setLanguageCode(String languageCode)
languageCode - The language code.public String getType()
public void setType(String type)
type - The type of the entity.public String getContext()
public void setContext(String context)
context - The context of the entity.public String getDocumentId()
public void setDocumentId(String documentId)
documentId - The document ID.public long getExtractionDate()
public void setExtractionDate(long extractionDate)
extractionDate - The extraction date.public Map<String,String> getMetadata()
Copyright © 2017. All rights reserved.