TextClassifierEvent
abstract class TextClassifierEvent : Parcelable
kotlin.Any | |
↳ | android.view.textclassifier.TextClassifierEvent |
This class represents events that are sent by components to the TextClassifier
to report something of note that relates to a feature powered by the TextClassifier. The TextClassifier may log these events or use them to improve future responses to queries.
Each category of events has its their own subclass. Events of each type have an associated set of related properties. You can find their specification in the subclasses.
Summary
Nested classes | |
---|---|
abstract |
Builder to build a text classifier event. |
This class represents events that are related to the conversation actions feature. |
|
This class represents events that are related to the language detection feature. |
|
This class represents events that are related to the smart linkify feature. |
|
This class represents events that are related to the smart text selection feature. |
Constants | |
---|---|
static Int |
Conversation actions |
static Int |
Language detection |
static Int |
Linkify |
static Int |
Smart selection |
static Int |
TextClassifier generated some actions |
static Int |
Smart actions shown to the user. |
static Int |
Something else other than user or the default TextClassifier triggered a selection. |
static Int |
User clicked on Copy action. |
static Int |
User clicked on Cut action. |
static Int |
Some text links were generated. |
static Int |
User clicked a link. |
static Int |
User composed a reply. |
static Int |
User clicked on a custom action. |
static Int |
User typed over the selection. |
static Int |
User clicked on Paste action. |
static Int |
Selection is destroyed. |
static Int |
User dragged+dropped the selection. |
static Int |
User modified an existing selection. |
static Int |
User reset the smart selection. |
static Int |
User started a new selection. |
static Int |
User clicked on Select All action |
static Int |
User clicked on Share action. |
static Int |
User clicked on a Smart action. |
static Int |
Smart selection triggered spanning multiple tokens (words). |
static Int |
Smart selection triggered for a single token (word). |
Inherited constants | |
---|---|
Public methods | |
---|---|
open Int | |
open IntArray |
Returns the indices of the actions relating to this event. |
open Array<String!> |
Returns an array of entity types. |
open Int |
Returns the event category. |
open TextClassificationContext? |
Returns the event context. |
open Int |
Returns the index of this event in the series of event it belongs to. |
open Int |
Returns the event type. |
open Bundle |
Returns a bundle containing non-structured extra information about this event. |
open ULocale? |
Returns the detected locale. |
open String? |
Returns the model name. |
open String? |
Returns the id of the text classifier result related to this event. |
open FloatArray |
Returns the scores of the suggestions. |
open String |
toString() |
open Unit |
writeToParcel(dest: Parcel, flags: Int) |
Properties | |
---|---|
static Parcelable.Creator<TextClassifierEvent!> |
Constants
CATEGORY_CONVERSATION_ACTIONS
static val CATEGORY_CONVERSATION_ACTIONS: Int
Conversation actions
Value: 3
CATEGORY_LANGUAGE_DETECTION
static val CATEGORY_LANGUAGE_DETECTION: Int
Language detection
Value: 4
CATEGORY_SELECTION
static val CATEGORY_SELECTION: Int
Smart selection
Value: 1
TYPE_ACTIONS_GENERATED
static val TYPE_ACTIONS_GENERATED: Int
TextClassifier generated some actions
Value: 20
TYPE_ACTIONS_SHOWN
static val TYPE_ACTIONS_SHOWN: Int
Smart actions shown to the user.
Value: 6
TYPE_AUTO_SELECTION
static val TYPE_AUTO_SELECTION: Int
Something else other than user or the default TextClassifier triggered a selection.
Value: 5
TYPE_COPY_ACTION
static val TYPE_COPY_ACTION: Int
User clicked on Copy action.
Value: 9
TYPE_CUT_ACTION
static val TYPE_CUT_ACTION: Int
User clicked on Cut action.
Value: 11
TYPE_LINKS_GENERATED
static val TYPE_LINKS_GENERATED: Int
Some text links were generated.
Value: 21
TYPE_LINK_CLICKED
static val TYPE_LINK_CLICKED: Int
User clicked a link.
Value: 7
TYPE_MANUAL_REPLY
static val TYPE_MANUAL_REPLY: Int
User composed a reply.
Value: 19
TYPE_OTHER_ACTION
static val TYPE_OTHER_ACTION: Int
User clicked on a custom action.
Value: 16
TYPE_OVERTYPE
static val TYPE_OVERTYPE: Int
User typed over the selection.
Value: 8
TYPE_PASTE_ACTION
static val TYPE_PASTE_ACTION: Int
User clicked on Paste action.
Value: 10
TYPE_SELECTION_DESTROYED
static val TYPE_SELECTION_DESTROYED: Int
Selection is destroyed.
Value: 15
TYPE_SELECTION_DRAG
static val TYPE_SELECTION_DRAG: Int
User dragged+dropped the selection.
Value: 14
TYPE_SELECTION_MODIFIED
static val TYPE_SELECTION_MODIFIED: Int
User modified an existing selection.
Value: 2
TYPE_SELECTION_RESET
static val TYPE_SELECTION_RESET: Int
User reset the smart selection.
Value: 18
TYPE_SELECTION_STARTED
static val TYPE_SELECTION_STARTED: Int
User started a new selection.
Value: 1
TYPE_SELECT_ALL
static val TYPE_SELECT_ALL: Int
User clicked on Select All action
Value: 17
TYPE_SHARE_ACTION
static val TYPE_SHARE_ACTION: Int
User clicked on Share action.
Value: 12
TYPE_SMART_ACTION
static val TYPE_SMART_ACTION: Int
User clicked on a Smart action.
Value: 13
TYPE_SMART_SELECTION_MULTI
static val TYPE_SMART_SELECTION_MULTI: Int
Smart selection triggered spanning multiple tokens (words).
Value: 4
TYPE_SMART_SELECTION_SINGLE
static val TYPE_SMART_SELECTION_SINGLE: Int
Smart selection triggered for a single token (word).
Value: 3
Public methods
describeContents
open 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 |
getActionIndices
open fun getActionIndices(): IntArray
Returns the indices of the actions relating to this event. Actions are usually returned by the text classifier in priority order with the most preferred action at index 0. This list gives an indication of the position of the actions that are being reported.
Return | |
---|---|
IntArray |
This value cannot be null . |
getEntityTypes
open fun getEntityTypes(): Array<String!>
Returns an array of entity types. e.g. TextClassifier.TYPE_ADDRESS
.
Return | |
---|---|
Array<String!> |
This value cannot be null . |
getEventCategory
open fun getEventCategory(): Int
Returns the event category. e.g. CATEGORY_SELECTION
.
getEventContext
open fun getEventContext(): TextClassificationContext?
Returns the event context.
Return | |
---|---|
TextClassificationContext? |
This value may be null . |
getEventIndex
open fun getEventIndex(): Int
Returns the index of this event in the series of event it belongs to.
getEventType
open fun getEventType(): Int
Returns the event type. e.g. TYPE_SELECTION_STARTED
.
getExtras
open fun getExtras(): Bundle
Returns a bundle containing non-structured extra information about this event.
NOTE: Do not modify this bundle.
Return | |
---|---|
Bundle |
This value cannot be null . |
getLocale
open fun getLocale(): ULocale?
Returns the detected locale.
Return | |
---|---|
ULocale? |
This value may be null . |
getModelName
open fun getModelName(): String?
Returns the model name.
Return | |
---|---|
String? |
This value may be null . |
getResultId
open fun getResultId(): String?
Returns the id of the text classifier result related to this event.
Return | |
---|---|
String? |
This value may be null . |
getScores
open fun getScores(): FloatArray
Returns the scores of the suggestions.
Return | |
---|---|
FloatArray |
This value cannot be null . |
toString
open fun toString(): String
Return | |
---|---|
String |
a string representation of the object. |
writeToParcel
open 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 |