★ wanayoo — archive 1999 https://developer.android.com/reference/android/view/textclassifier/TextClassification.Builder.htmlNouvelle recherche | Portail wanayoo
Skip to content

Most visited

Recently visited

navigation

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 object.

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

From class java.lang.Object

Public constructors

TextClassification.Builder

added in API level 26
TextClassification.Builder ()

Public methods

build

added in API level 26
TextClassification build ()

Builds and returns a TextClassification object.

Returns
TextClassification

setEntityType

added in API level 26
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 null.

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

added in API level 26
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 null.

Returns
TextClassification.Builder

setIntent

added in API level 26
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 null.

Returns
TextClassification.Builder

setLabel

added in API level 26
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 null.

Returns
TextClassification.Builder

setOnClickListener

added in API level 26
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 null.

Returns
TextClassification.Builder

setText

added in API level 26
TextClassification.Builder setText (String text)

Sets the classified text.

Parameters
text String

This value may be null.

Returns
TextClassification.Builder

This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Follow Google Developers on WeChat

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a short survey?
Help us improve the Android developer experience.
(Sep 2017 survey)