ITextClassifier.ClassifyText Method

Definition

Overloads

Name Description
ClassifyText(TextClassification+Request)

Classifies the specified text and returns a TextClassification object that can be used to generate a widget for handling the classified text.

ClassifyText(ICharSequence, Int32, Int32, LocaleList)

Classifies the specified text and returns a TextClassification object that can be used to generate a widget for handling the classified text.

ClassifyText(TextClassification+Request)

Classifies the specified text and returns a TextClassification object that can be used to generate a widget for handling the classified text.

[Android.Runtime.Register("classifyText", "(Landroid/view/textclassifier/TextClassification$Request;)Landroid/view/textclassifier/TextClassification;", "GetClassifyText_Landroid_view_textclassifier_TextClassification_Request_Handler:Android.Views.TextClassifiers.ITextClassifier, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=28)]
public virtual Android.Views.TextClassifiers.TextClassification ClassifyText(Android.Views.TextClassifiers.TextClassification.Request request);
[<Android.Runtime.Register("classifyText", "(Landroid/view/textclassifier/TextClassification$Request;)Landroid/view/textclassifier/TextClassification;", "GetClassifyText_Landroid_view_textclassifier_TextClassification_Request_Handler:Android.Views.TextClassifiers.ITextClassifier, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=28)>]
abstract member ClassifyText : Android.Views.TextClassifiers.TextClassification.Request -> Android.Views.TextClassifiers.TextClassification
override this.ClassifyText : Android.Views.TextClassifiers.TextClassification.Request -> Android.Views.TextClassifiers.TextClassification

Parameters

request
TextClassification.Request

TextClassification.Request: the text classification request. This value cannot be null.

Returns

This value cannot be null.

Attributes

Remarks

Classifies the specified text and returns a TextClassification object that can be used to generate a widget for handling the classified text. NOTE: Call on a worker thread. NOTE: If a TextClassifier has been destroyed, calls to this method should throw an IllegalStateException. See isDestroyed(). This method may take several seconds to complete, so it should only be called from a worker thread.

Android reference for android.view.textclassifier.TextClassifier.classifyText.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

ClassifyText(ICharSequence, Int32, Int32, LocaleList)

Classifies the specified text and returns a TextClassification object that can be used to generate a widget for handling the classified text.

[Android.Runtime.Register("classifyText", "(Ljava/lang/CharSequence;IILandroid/os/LocaleList;)Landroid/view/textclassifier/TextClassification;", "GetClassifyText_Ljava_lang_CharSequence_IILandroid_os_LocaleList_Handler:Android.Views.TextClassifiers.ITextClassifierInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=26)]
public Android.Views.TextClassifiers.TextClassification ClassifyText(Java.Lang.ICharSequence text, int startIndex, int endIndex, Android.OS.LocaleList? defaultLocales);
[<Android.Runtime.Register("classifyText", "(Ljava/lang/CharSequence;IILandroid/os/LocaleList;)Landroid/view/textclassifier/TextClassification;", "GetClassifyText_Ljava_lang_CharSequence_IILandroid_os_LocaleList_Handler:Android.Views.TextClassifiers.ITextClassifierInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=26)>]
abstract member ClassifyText : Java.Lang.ICharSequence * int * int * Android.OS.LocaleList -> Android.Views.TextClassifiers.TextClassification

Parameters

text
ICharSequence

CharSequence: text providing context for the text to classify (which is specified by the sub sequence starting at startIndex and ending at endIndex). This value cannot be null.

startIndex
Int32

int: start index of the text to classify. Value is 0 or greater

endIndex
Int32

int: end index of the text to classify. Value is 0 or greater

defaultLocales
LocaleList

LocaleList: ordered list of locale preferences that may be used to disambiguate the provided text. If no locale preferences exist, set this to null or an empty locale list.

Returns

This value cannot be null.

Attributes

Remarks

Classifies the specified text and returns a TextClassification object that can be used to generate a widget for handling the classified text. NOTE: Call on a worker thread. NOTE: Do not implement. The default implementation of this method calls classifyText(TextClassification.Request). If that method calls this method, a stack overflow error will happen. NOTE: If a TextClassifier has been destroyed, calls to this method should throw an IllegalStateException. See isDestroyed(). This method may take several seconds to complete, so it should only be called from a worker thread.

See also:

Throws: IllegalArgumentException if text is null; startIndex is negative; endIndex is greater than text.length() or not greater than startIndex

Android reference for android.view.textclassifier.TextClassifier.classifyText.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to