TextClassifier
abstract class TextClassifier
kotlin.Any | |
↳ | androidx.textclassifier.TextClassifier |
Interface for providing text classification related features. TextClassifier acts as a proxy to either the system provided TextClassifier, or an equivalent implementation provided by an app. Each instance of the class therefore represents one connection to the classifier implementation.
Unless otherwise stated, methods of this interface are blocking operations. Avoid calling them on the UI thread.
Summary
Nested classes | |
---|---|
Configuration object for specifying what entities to identify. |
Constants | |
---|---|
static String |
Designates that the text in question is editable. |
static String |
Designates that the text in question is not editable. |
static String |
Identifies a physical address. |
static String |
Time reference that is no more specific than a date. |
static String |
Time reference that includes a specific time. |
static String |
Identifies an e-mail address. |
static String |
Flight number in IATA format. |
static String |
Signifies that the classifier ran, but didn't recognize a know entity. |
static String |
Identifies a phone number. |
static String |
Signifies that the TextClassifier did not identify an entity. |
static String |
Identifies a URL. |
static String |
The widget involved in the text classification session is a custom editable text widget. |
static String |
The widget involved in the text classification session is a custom text widget. |
static String |
The widget involved in the text classification session is a custom non-selectable text widget. |
static String |
The widget involved in the text classification session is a standard |
static String |
The widget involved in the text classification session is a standard editable |
static String |
The widget involved in the text classification session is a standard |
static String |
The widget involved in the text classification session is of an unknown/unspecified type. |
static String |
The widget involved in the text classification session is a standard non-selectable |
static String |
The widget involved in the text classification session is a standard |
Public constructors | |
---|---|
<init>() Interface for providing text classification related features. |
Public methods | |
---|---|
open TextClassification |
classifyText(@NonNull request: TextClassification.Request) Classifies the specified text and returns a |
open TextLinks |
generateLinks(@NonNull request: TextLinks.Request) Generates and returns a |
open Int |
Returns the maximal length of text that can be processed by generateLinks. |
open ConversationActions |
suggestConversationActions(@NonNull request: ConversationActions.Request) Suggests and returns a list of actions according to the given conversation. |
open TextSelection |
suggestSelection(@NonNull request: TextSelection.Request) Returns suggested text selection start and end indices, recognized entity types, and their associated confidence scores. |
Properties | |
---|---|
static TextClassifier! |
No-op TextClassifier. |
Constants
HINT_TEXT_IS_EDITABLE
static val HINT_TEXT_IS_EDITABLE: String
Designates that the text in question is editable.
Value: "android.text_is_editable"
HINT_TEXT_IS_NOT_EDITABLE
static val HINT_TEXT_IS_NOT_EDITABLE: String
Designates that the text in question is not editable.
Value: "android.text_is_not_editable"
TYPE_DATE
static val TYPE_DATE: String
Time reference that is no more specific than a date. May be absolute such as "01/01/2000" or relative like "tomorrow".
Value: "date"
TYPE_DATE_TIME
static val TYPE_DATE_TIME: String
Time reference that includes a specific time. May be absolute such as "01/01/2000 5:30pm" or relative like "tomorrow at 5:30pm".
Value: "datetime"
TYPE_FLIGHT_NUMBER
static val TYPE_FLIGHT_NUMBER: String
Flight number in IATA format.
Value: "flight"
TYPE_OTHER
static val TYPE_OTHER: String
Signifies that the classifier ran, but didn't recognize a know entity.
Value: "other"