class TextLinks.TextLink


A link, identifying a substring of text and possible entity types for it.

Summary

Public functions

java-static TextLinks.TextLink

Extracts a TextLink from a bundle that was added using toBundle.

@FloatRange(from = 0.0, to = 1.0) Float
getConfidenceScore(entityType: String!)

Returns the confidence score for a particular entity type.

Int

Returns the end index of this link in the original text.

String

Returns the entity type at a given index.

Int

Returns the number of entity types that have confidence scores.

Int

Returns the start index of this link in the original text.

Bundle

Adds this TextLink to a Bundle that can be read back with the same parameters to createFromBundle.

String

Public functions

createFromBundle

java-static fun createFromBundle(bundle: Bundle): TextLinks.TextLink

Extracts a TextLink from a bundle that was added using toBundle.

getConfidenceScore

fun getConfidenceScore(entityType: String!): @FloatRange(from = 0.0, to = 1.0) Float

Returns the confidence score for a particular entity type.

Parameters
entityType: String!

the entity type.

getEnd

fun getEnd(): Int

Returns the end index of this link in the original text.

Returns
Int

the end index.

getEntityType

fun getEntityType(index: Int): String

Returns the entity type at a given index. Entity types are sorted by confidence.

Returns
String

the entity type at the provided index.

getEntityTypeCount

fun getEntityTypeCount(): Int

Returns the number of entity types that have confidence scores.

Returns
Int

the entity type count.

getStart

fun getStart(): Int

Returns the start index of this link in the original text.

Returns
Int

the start index.

toBundle

fun toBundle(): Bundle

Adds this TextLink to a Bundle that can be read back with the same parameters to createFromBundle.

toString

fun toString(): String