TextClassificationManager
public
final
class
TextClassificationManager
extends Object
java.lang.Object | |
↳ | androidx.textclassifier.TextClassificationManager |
Class to handle the creation of TextClassifier
.
Summary
Public methods | |
---|---|
TextClassifier
|
getDefaultTextClassifier()
Returns the default text classifier provided by this library. |
TextClassifier
|
getTextClassifier()
Returns the text classifier set through |
static
TextClassificationManager
|
of(Context context)
Returns an instance of |
void
|
setTextClassifier(TextClassifier textClassifier)
Sets a preferred text classifier. |
Inherited methods | |
---|---|
Public methods
getDefaultTextClassifier
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)
.
Returns | |
---|---|
TextClassifier |
See also:
getTextClassifier
public 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.
If you are implementing a text classifier, and want to delegate requests to the default
text classifier provided by this library, you may want to use
getDefaultTextClassifier()
instead.
Returns | |
---|---|
TextClassifier |
See also:
of
public static TextClassificationManager of (Context context)
Returns an instance of TextClassificationManager
for the specified context.
Each context has its own TextClassificationManager
.
Parameters | |
---|---|
context |
Context |
Returns | |
---|---|
TextClassificationManager |
setTextClassifier
public void setTextClassifier (TextClassifier textClassifier)
Sets a preferred text classifier.
To turn off the feature completely, you can set a TextClassifier.NO_OP
. If
null
is set, default text classifier is used.
Note that the given text classifier is only set to this instance of the
TextClassificationManager
.
Parameters | |
---|---|
textClassifier |
TextClassifier |