Summary: Ctors | Methods | Inherited Methods
public
static
final
class
TextSelection.Builder
extends Object
Builder used to build TextSelection objects.
Summary
Public constructors | |
|---|---|
Builder(int startIndex, int endIndex)
Creates a builder used to build |
|
Public methods | |
|---|---|
TextSelection
|
build()
Builds and returns |
TextSelection.Builder
|
setEntityType(String type, float confidenceScore)
Sets an entity type for the classified text and assigns a confidence score. |
TextSelection.Builder
|
setExtras(Bundle extras)
Sets the extended data. |
TextSelection.Builder
|
setId(String id)
Sets an id for the TextSelection object. |
TextSelection.Builder
|
setTextClassification(TextClassification textClassification)
Sets the text classification result of the suggested selection. |
Inherited methods | |||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
From class
| |||||||||||||||||||||||
Public constructors
Builder
public Builder (int startIndex,
int endIndex)
Creates a builder used to build TextSelection objects.
| Parameters | |
|---|---|
startIndex |
int: the start index of the text selection.
Value is 0 or greater |
endIndex |
int: the end index of the text selection. Must be greater than startIndex.
Value is 0 or greater |
Public methods
setTextClassification
public TextSelection.Builder setTextClassification (TextClassification textClassification)
Sets the text classification result of the suggested selection. If
Request.shouldIncludeTextClassification() is true, set this value.
Otherwise this value may be set to null. The intention of this method is to avoid
doing expensive work if the client is not interested in such result.
| Parameters | |
|---|---|
textClassification |
TextClassification: This value may be null. |
| Returns | |
|---|---|
TextSelection.Builder |
this builder |