Stay organized with collections
Save and categorize content based on your preferences.
TextLink
class TextLink : Parcelable
A link, identifying a substring of text and possible entity types for it.
Summary
Inherited constants |
From class Parcelable
Int |
CONTENTS_FILE_DESCRIPTOR
Descriptor bit used with describeContents() : indicates that the Parcelable object's flattened representation includes a file descriptor.
|
Int |
PARCELABLE_WRITE_RETURN_VALUE
Flag for use with writeToParcel : the object being written is a return value, that is the result of a function such as "Parcelable someFunction() ", "void someFunction(out Parcelable) ", or "void someFunction(inout Parcelable) ". Some implementations may want to release resources at this point.
|
|
Public methods |
Int |
|
Float |
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.
|
Bundle |
Returns a bundle containing custom data related to this TextLink.
|
Int |
Returns the start index of this link in the original text.
|
String |
|
Unit |
|
Public methods
describeContents
fun describeContents(): Int
getConfidenceScore
fun getConfidenceScore(entityType: String!): Float
Returns the confidence score for a particular entity type.
Parameters |
entityType |
String!: the entity type Value is android.view.textclassifier.TextClassifier#TYPE_UNKNOWN , android.view.textclassifier.TextClassifier#TYPE_OTHER , android.view.textclassifier.TextClassifier#TYPE_EMAIL , android.view.textclassifier.TextClassifier#TYPE_PHONE , android.view.textclassifier.TextClassifier#TYPE_ADDRESS , android.view.textclassifier.TextClassifier#TYPE_URL , android.view.textclassifier.TextClassifier#TYPE_DATE , android.view.textclassifier.TextClassifier#TYPE_DATE_TIME , android.view.textclassifier.TextClassifier#TYPE_FLIGHT_NUMBER , android.view.textclassifier.TextClassifier.TYPE_DICTIONARY, or android.view.textclassifier.TextClassifier.TYPE_OTP |
Return |
Float |
Value is between 0.0 and 1.0 inclusive |
getEnd
fun getEnd(): Int
Returns the end index of this link in the original text.
getEntity
fun getEntity(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 This value cannot be null . Value is android.view.textclassifier.TextClassifier#TYPE_UNKNOWN , android.view.textclassifier.TextClassifier#TYPE_OTHER , android.view.textclassifier.TextClassifier#TYPE_EMAIL , android.view.textclassifier.TextClassifier#TYPE_PHONE , android.view.textclassifier.TextClassifier#TYPE_ADDRESS , android.view.textclassifier.TextClassifier#TYPE_URL , android.view.textclassifier.TextClassifier#TYPE_DATE , android.view.textclassifier.TextClassifier#TYPE_DATE_TIME , android.view.textclassifier.TextClassifier#TYPE_FLIGHT_NUMBER , android.view.textclassifier.TextClassifier.TYPE_DICTIONARY, or android.view.textclassifier.TextClassifier.TYPE_OTP |
getEntityCount
fun getEntityCount(): Int
Returns the number of entity types that have confidence scores.
Return |
Int |
the entity count |
fun getExtras(): Bundle
Returns a bundle containing custom data related to this TextLink.
Return |
Bundle |
This value cannot be null . |
getStart
fun getStart(): Int
Returns the start index of this link in the original text.
Return |
Int |
the start index |
toString
fun toString(): String
Return |
String |
a string representation of the object. |
Properties
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-01-23 UTC.