TextLink
class TextLink : Parcelable
kotlin.Any | |
↳ | android.view.textclassifier.TextLinks.TextLink |
A link, identifying a substring of text and possible entity types for it.
Summary
Inherited constants | |
---|---|
Public methods | |
---|---|
Int | |
Float |
getConfidenceScore(entityType: String!) Returns the confidence score for a particular entity type. |
Int |
getEnd() 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 |
getStart() Returns the start index of this link in the original text. |
String |
toString() |
Unit |
writeToParcel(dest: Parcel, flags: Int) |
Properties | |
---|---|
static Parcelable.Creator<TextLinks.TextLink!> |
Public methods
describeContents
fun describeContents(): Int
Return | |
---|---|
Int |
a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or android.os.Parcelable#CONTENTS_FILE_DESCRIPTOR |
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 , or android.view.textclassifier.TextClassifier.TYPE_DICTIONARY |
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.
Return | |
---|---|
Int |
the end index |
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 , or android.view.textclassifier.TextClassifier.TYPE_DICTIONARY |
getEntityCount
fun getEntityCount(): Int
Returns the number of entity types that have confidence scores.
Return | |
---|---|
Int |
the entity count |
getExtras
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. |
writeToParcel
fun writeToParcel(
dest: Parcel,
flags: Int
): Unit
Parameters | |
---|---|
dest |
Parcel: The Parcel in which the object should be written. This value cannot be null . |
flags |
Int: Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE . Value is either 0 or a combination of android.os.Parcelable#PARCELABLE_WRITE_RETURN_VALUE , and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES |