Added in API level 34

Builder


class Builder
kotlin.Any
   ↳ android.speech.RecognitionPart.Builder

A builder for RecognitionPart

Summary

Public constructors
Builder(rawText: String)

Creates a new Builder.

Public methods
RecognitionPart

Builds the instance.

RecognitionPart.Builder

The level of confidence for this part if requested with RecognizerIntent#EXTRA_REQUEST_WORD_CONFIDENCE.

RecognitionPart.Builder

The formatted text version of the recognized part of the result.

RecognitionPart.Builder

The non-null raw text version of the recognized part of the result.

RecognitionPart.Builder

Non-negative offset of the beginning of this part from the start of the recognition session in milliseconds if requested with RecognizerIntent#EXTRA_REQUEST_WORD_TIMING.

Public constructors

Builder

Added in API level 34
Builder(rawText: String)

Creates a new Builder.

Parameters
rawText String: The non-null raw text version of the recognized part of the result.

Public methods

build

Added in API level 34
fun build(): RecognitionPart

Builds the instance. This builder should not be touched after calling this!

Return
RecognitionPart This value cannot be null.

setFormattedText

Added in API level 34
fun setFormattedText(value: String): RecognitionPart.Builder

The formatted text version of the recognized part of the result. If formatting is enabled with RecognizerIntent#EXTRA_ENABLE_FORMATTING, it has a non-null value.

Otherwise, it should be null by default.

Parameters
value String: This value cannot be null.

setRawText

Added in API level 34
fun setRawText(value: String): RecognitionPart.Builder

The non-null raw text version of the recognized part of the result.

Parameters
value String: This value cannot be null.

setTimestampMillis

Added in API level 34
fun setTimestampMillis(value: Long): RecognitionPart.Builder

Non-negative offset of the beginning of this part from the start of the recognition session in milliseconds if requested with RecognizerIntent#EXTRA_REQUEST_WORD_TIMING.

Otherwise, this should equal 0.

Return
RecognitionPart.Builder This value cannot be null.