TextClassifierEvent
public
abstract
class
TextClassifierEvent
extends Object
implements
Parcelable
java.lang.Object | |
↳ | 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 | |
---|---|
class |
TextClassifierEvent.Builder<T extends Builder<T>>
Builder to build a text classifier event. |
class |
TextClassifierEvent.ConversationActionsEvent
This class represents events that are related to the conversation actions feature. |
class |
TextClassifierEvent.LanguageDetectionEvent
This class represents events that are related to the language detection feature. |
class |
TextClassifierEvent.TextLinkifyEvent
This class represents events that are related to the smart linkify feature. |
class |
TextClassifierEvent.TextSelectionEvent
This class represents events that are related to the smart text selection feature. |
Constants | |
---|---|
int |
CATEGORY_CONVERSATION_ACTIONS
Conversation actions |
int |
CATEGORY_LANGUAGE_DETECTION
Language detection |
int |
CATEGORY_LINKIFY
Linkify |
int |
CATEGORY_SELECTION
Smart selection |
int |
TYPE_ACTIONS_GENERATED
TextClassifier generated some actions |
int |
TYPE_ACTIONS_SHOWN
Smart actions shown to the user. |
int |
TYPE_AUTO_SELECTION
Something else other than user or the default TextClassifier triggered a selection. |
int |
TYPE_COPY_ACTION
User clicked on Copy action. |
int |
TYPE_CUT_ACTION
User clicked on Cut action. |
int |
TYPE_LINKS_GENERATED
Some text links were generated. |
int |
TYPE_LINK_CLICKED
User clicked a link. |
int |
TYPE_MANUAL_REPLY
User composed a reply. |
int |
TYPE_OTHER_ACTION
User clicked on a custom action. |
int |
TYPE_OVERTYPE
User typed over the selection. |
int |
TYPE_PASTE_ACTION
User clicked on Paste action. |
int |
TYPE_SELECTION_DESTROYED
Selection is destroyed. |
int |
TYPE_SELECTION_DRAG
User dragged+dropped the selection. |
int |
TYPE_SELECTION_MODIFIED
User modified an existing selection. |
int |
TYPE_SELECTION_RESET
User reset the smart selection. |
int |
TYPE_SELECTION_STARTED
User started a new selection. |
int |
TYPE_SELECT_ALL
User clicked on Select All action |
int |
TYPE_SHARE_ACTION
User clicked on Share action. |
int |
TYPE_SMART_ACTION
User clicked on a Smart action. |
int |
TYPE_SMART_SELECTION_MULTI
Smart selection triggered spanning multiple tokens (words). |
int |
TYPE_SMART_SELECTION_SINGLE
Smart selection triggered for a single token (word). |
Inherited constants |
---|
Fields | |
---|---|
public
static
final
Creator<TextClassifierEvent> |
CREATOR
|
Public methods | |
---|---|
int
|
describeContents()
Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. |
int[]
|
getActionIndices()
Returns the indices of the actions relating to this event. |
String[]
|
getEntityTypes()
Returns an array of entity types. |
int
|
getEventCategory()
Returns the event category. |
TextClassificationContext
|
getEventContext()
Returns the event context. |
int
|
getEventIndex()
Returns the index of this event in the series of event it belongs to. |
int
|
getEventType()
Returns the event type. |
Bundle
|
getExtras()
Returns a bundle containing non-structured extra information about this event. |
ULocale
|
getLocale()
Returns the detected locale. |
String
|
getModelName()
Returns the model name. |
String
|
getResultId()
Returns the id of the text classifier result related to this event. |
float[]
|
getScores()
Returns the scores of the suggestions. |
String
|
toString()
Returns a string representation of the object. |
void
|
writeToParcel(Parcel dest, int flags)
Flatten this object in to a Parcel. |
Inherited methods | |
---|---|
Constants
CATEGORY_CONVERSATION_ACTIONS
public static final int CATEGORY_CONVERSATION_ACTIONS
Conversation actions
Constant Value: 3 (0x00000003)
CATEGORY_LANGUAGE_DETECTION
public static final int CATEGORY_LANGUAGE_DETECTION
Language detection
Constant Value: 4 (0x00000004)
CATEGORY_LINKIFY
public static final int CATEGORY_LINKIFY
Linkify
See also:
Constant Value: 2 (0x00000002)
CATEGORY_SELECTION
public static final int CATEGORY_SELECTION
Smart selection
See also:
Constant Value: 1 (0x00000001)
TYPE_ACTIONS_GENERATED
public static final int TYPE_ACTIONS_GENERATED
TextClassifier generated some actions
Constant Value: 20 (0x00000014)
TYPE_ACTIONS_SHOWN
public static final int TYPE_ACTIONS_SHOWN
Smart actions shown to the user.
Constant Value: 6 (0x00000006)
TYPE_AUTO_SELECTION
public static final int TYPE_AUTO_SELECTION
Something else other than user or the default TextClassifier triggered a selection.
Constant Value: 5 (0x00000005)
TYPE_COPY_ACTION
public static final int TYPE_COPY_ACTION
User clicked on Copy action.
Constant Value: 9 (0x00000009)
TYPE_CUT_ACTION
public static final int TYPE_CUT_ACTION
User clicked on Cut action.
Constant Value: 11 (0x0000000b)
TYPE_LINKS_GENERATED
public static final int TYPE_LINKS_GENERATED
Some text links were generated.
Constant Value: 21 (0x00000015)
TYPE_LINK_CLICKED
public static final int TYPE_LINK_CLICKED
User clicked a link.
Constant Value: 7 (0x00000007)
TYPE_MANUAL_REPLY
public static final int TYPE_MANUAL_REPLY
User composed a reply.
Constant Value: 19 (0x00000013)
TYPE_OTHER_ACTION
public static final int TYPE_OTHER_ACTION
User clicked on a custom action.
Constant Value: 16 (0x00000010)
TYPE_OVERTYPE
public static final int TYPE_OVERTYPE
User typed over the selection.
Constant Value: 8 (0x00000008)
TYPE_PASTE_ACTION
public static final int TYPE_PASTE_ACTION
User clicked on Paste action.
Constant Value: 10 (0x0000000a)
TYPE_SELECTION_DESTROYED
public static final int TYPE_SELECTION_DESTROYED
Selection is destroyed.
Constant Value: 15 (0x0000000f)
TYPE_SELECTION_DRAG
public static final int TYPE_SELECTION_DRAG
User dragged+dropped the selection.
Constant Value: 14 (0x0000000e)
TYPE_SELECTION_MODIFIED
public static final int TYPE_SELECTION_MODIFIED
User modified an existing selection.
Constant Value: 2 (0x00000002)
TYPE_SELECTION_RESET
public static final int TYPE_SELECTION_RESET
User reset the smart selection.
Constant Value: 18 (0x00000012)
TYPE_SELECTION_STARTED
public static final int TYPE_SELECTION_STARTED
User started a new selection.
Constant Value: 1 (0x00000001)
TYPE_SELECT_ALL
public static final int TYPE_SELECT_ALL
User clicked on Select All action
Constant Value: 17 (0x00000011)
TYPE_SHARE_ACTION
public static final int TYPE_SHARE_ACTION
User clicked on Share action.
Constant Value: 12 (0x0000000c)
TYPE_SMART_ACTION
public static final int TYPE_SMART_ACTION
User clicked on a Smart action.
Constant Value: 13 (0x0000000d)
TYPE_SMART_SELECTION_MULTI
public static final int TYPE_SMART_SELECTION_MULTI
Smart selection triggered spanning multiple tokens (words).
Constant Value: 4 (0x00000004)
TYPE_SMART_SELECTION_SINGLE
public static final int TYPE_SMART_SELECTION_SINGLE
Smart selection triggered for a single token (word).
Constant Value: 3 (0x00000003)
Fields
Public methods
describeContents
public int describeContents ()
Describe the kinds of special objects contained in this Parcelable
instance's marshaled representation. For example, if the object will
include a file descriptor in the output of writeToParcel(android.os.Parcel, int)
,
the return value of this method must include the
CONTENTS_FILE_DESCRIPTOR
bit.
Returns | |
---|---|
int |
a bitmask indicating the set of special object types marshaled
by this Parcelable object instance.
Value is either 0 or CONTENTS_FILE_DESCRIPTOR |
getActionIndices
public int[] getActionIndices ()
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.
Returns | |
---|---|
int[] |
This value cannot be null . |
getEntityTypes
public String[] getEntityTypes ()
Returns an array of entity types. e.g. TextClassifier#TYPE_ADDRESS
.
Returns | |
---|---|
String[] |
This value cannot be null . |
See also:
getEventCategory
public int getEventCategory ()
Returns the event category. e.g. CATEGORY_SELECTION
.
Returns | |
---|---|
int |
Value is CATEGORY_SELECTION , CATEGORY_LINKIFY , CATEGORY_CONVERSATION_ACTIONS , or CATEGORY_LANGUAGE_DETECTION |
getEventContext
public TextClassificationContext getEventContext ()
Returns the event context.
Returns | |
---|---|
TextClassificationContext |
This value may be null . |
getEventIndex
public int getEventIndex ()
Returns the index of this event in the series of event it belongs to.
Returns | |
---|---|
int |
getEventType
public int getEventType ()
Returns the event type. e.g. TYPE_SELECTION_STARTED
.
Returns | |
---|---|
int |
Value is TYPE_SELECTION_STARTED , TYPE_SELECTION_MODIFIED , TYPE_SMART_SELECTION_SINGLE , TYPE_SMART_SELECTION_MULTI , TYPE_AUTO_SELECTION , TYPE_ACTIONS_SHOWN , TYPE_LINK_CLICKED , TYPE_OVERTYPE , TYPE_COPY_ACTION , TYPE_PASTE_ACTION , TYPE_CUT_ACTION , TYPE_SHARE_ACTION , TYPE_SMART_ACTION , TYPE_SELECTION_DRAG , TYPE_SELECTION_DESTROYED , TYPE_OTHER_ACTION , TYPE_SELECT_ALL , TYPE_SELECTION_RESET , TYPE_MANUAL_REPLY , TYPE_ACTIONS_GENERATED , TYPE_LINKS_GENERATED , or android.view.textclassifier.TextClassifierEvent.TYPE_READ_CLIPBOARD |
getExtras
public Bundle getExtras ()
Returns a bundle containing non-structured extra information about this event.
NOTE: Do not modify this bundle.
Returns | |
---|---|
Bundle |
This value cannot be null . |
getLocale
public ULocale getLocale ()
Returns the detected locale.
Returns | |
---|---|
ULocale |
This value may be null . |
getModelName
public String getModelName ()
Returns the model name.
Returns | |
---|---|
String |
This value may be null . |
getResultId
public String getResultId ()
Returns the id of the text classifier result related to this event.
Returns | |
---|---|
String |
This value may be null . |
getScores
public float[] getScores ()
Returns the scores of the suggestions.
Returns | |
---|---|
float[] |
This value cannot be null . |
toString
public String toString ()
Returns a string representation of the object.
Returns | |
---|---|
String |
a string representation of the object. |
writeToParcel
public void writeToParcel (Parcel dest, int flags)
Flatten this object in to a Parcel.
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.PARCELABLE_WRITE_RETURN_VALUE .
Value is either 0 or a combination of Parcelable.PARCELABLE_WRITE_RETURN_VALUE , and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES |
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 2024-04-11 UTC.