TextClassification.Builder
public
static
final
class
TextClassification.Builder
extends Object
| java.lang.Object | |
| ↳ | android.view.textclassifier.TextClassification.Builder |
Builder for building TextClassification objects.
Summary
Public constructors | |
|---|---|
TextClassification.Builder()
|
|
Public methods | |
|---|---|
TextClassification
|
build()
Builds and returns a |
TextClassification.Builder
|
setEntityType(String type, float confidenceScore)
Sets an entity type for the classification result and assigns a confidence score. |
TextClassification.Builder
|
setIcon(Drawable icon)
Sets an icon that may be rendered on a widget used to act on the classified text. |
TextClassification.Builder
|
setIntent(Intent intent)
Sets an intent that may be fired to act on the classified text. |
TextClassification.Builder
|
setLabel(String label)
Sets a label that may be rendered on a widget used to act on the classified text. |
TextClassification.Builder
|
setOnClickListener(View.OnClickListener onClickListener)
Sets an OnClickListener that may be triggered to act on the classified text. |
TextClassification.Builder
|
setText(String text)
Sets the classified text. |
Inherited methods | |
|---|---|
java.lang.Object
| |
Public constructors
Public methods
build
TextClassification build ()
Builds and returns a TextClassification object.
| Returns | |
|---|---|
TextClassification |
|
setEntityType
TextClassification.Builder setEntityType (String type, float confidenceScore)
Sets an entity type for the classification result and assigns a confidence score.
| Parameters | |
|---|---|
type |
String This value must never be |
confidenceScore |
float: a value from 0 (low confidence) to 1 (high confidence).
0 implies the entity does not exist for the classified text.
Values greater than 1 are clamped to 1.
Value is between 0.0 and 1.0 inclusive. |
| Returns | |
|---|---|
TextClassification.Builder |
|
setIcon
TextClassification.Builder setIcon (Drawable icon)
Sets an icon that may be rendered on a widget used to act on the classified text.
| Parameters | |
|---|---|
icon |
Drawable This value may be |
| Returns | |
|---|---|
TextClassification.Builder |
|
setIntent
TextClassification.Builder setIntent (Intent intent)
Sets an intent that may be fired to act on the classified text.
| Parameters | |
|---|---|
intent |
Intent This value may be |
| Returns | |
|---|---|
TextClassification.Builder |
|
setLabel
TextClassification.Builder setLabel (String label)
Sets a label that may be rendered on a widget used to act on the classified text.
| Parameters | |
|---|---|
label |
String This value may be |
| Returns | |
|---|---|
TextClassification.Builder |
|
setOnClickListener
TextClassification.Builder setOnClickListener (View.OnClickListener onClickListener)
Sets an OnClickListener that may be triggered to act on the classified text.
| Parameters | |
|---|---|
onClickListener |
View.OnClickListener This value may be |
| Returns | |
|---|---|
TextClassification.Builder |
|
setText
TextClassification.Builder setText (String text)
Sets the classified text.
| Parameters | |
|---|---|
text |
String This value may be |
| Returns | |
|---|---|
TextClassification.Builder |
|