public final class TextClassificationManager
extends Object

   ↳ androidx.textclassifier.TextClassificationManager

Class to handle the creation of TextClassifier.


Public methods

TextClassifier getDefaultTextClassifier()

Returns the default text classifier provided by this library.

TextClassifier getTextClassifier()

Returns the text classifier set through setTextClassifier(TextClassifier), a default text classifier is returned if it is not ever set, or a null is set.

static TextClassificationManager of(Context context)

Returns an instance of TextClassificationManager for the specified context.

void setTextClassifier(TextClassifier textClassifier)

Sets a preferred text classifier.

Inherited methods

Public methods


public TextClassifier getDefaultTextClassifier ()

Returns the default text classifier provided by this library.

This is mainly for text classifier implementation to delegate the request to the default text classifier. Otherwise, in most cases, you shuold consider getTextClassifier() instead.

Note that the returned text classifier should be only used within the same context that is passed to of(Context).