TextLink

class TextLink
kotlin.Any
   ↳ androidx.textclassifier.TextLinks.TextLink

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

Summary

Public methods

static TextLinks.TextLink
createFromBundle(@NonNull bundle: Bundle)

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

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(Bundle).

String

Public methods

createFromBundle

@NonNull static fun createFromBundle(@NonNull bundle: Bundle): TextLinks.TextLink

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

getConfidenceScore

fun getConfidenceScore(entityType: String!): 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.

Return
Int: the end index.

getEntityType

@NonNull fun getEntityType(index: Int): String

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

Return
String: the entity type at the provided index.

getEntityTypeCount

fun getEntityTypeCount(): Int

Returns the number of entity types that have confidence scores.

Return
Int: the entity type count.

getStart

fun getStart(): Int

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

Return
Int: the start index.

toBundle

@NonNull fun toBundle(): Bundle

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

toString

@NonNull fun toString(): String