Class SpeechRecognitionAlternative.Builder (4.40.0)

public static final class SpeechRecognitionAlternative.Builder extends GeneratedMessageV3.Builder<SpeechRecognitionAlternative.Builder> implements SpeechRecognitionAlternativeOrBuilder

Alternative hypotheses (a.k.a. n-best list).

Protobuf type google.cloud.speech.v1beta1.SpeechRecognitionAlternative

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public SpeechRecognitionAlternative.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
SpeechRecognitionAlternative.Builder
Overrides

build()

public SpeechRecognitionAlternative build()
Returns
Type Description
SpeechRecognitionAlternative

buildPartial()

public SpeechRecognitionAlternative buildPartial()
Returns
Type Description
SpeechRecognitionAlternative

clear()

public SpeechRecognitionAlternative.Builder clear()
Returns
Type Description
SpeechRecognitionAlternative.Builder
Overrides

clearConfidence()

public SpeechRecognitionAlternative.Builder clearConfidence()

Output-only The confidence estimate between 0.0 and 1.0. A higher number indicates an estimated greater likelihood that the recognized words are correct. This field is typically provided only for the top hypothesis, and only for is_final=true results. Clients should not rely on the confidence field as it is not guaranteed to be accurate, or even set, in any of the results. The default of 0.0 is a sentinel value indicating confidence was not set.

float confidence = 2;

Returns
Type Description
SpeechRecognitionAlternative.Builder

clearField(Descriptors.FieldDescriptor field)

public SpeechRecognitionAlternative.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
SpeechRecognitionAlternative.Builder
Overrides

clearOneof(Descriptors.OneofDescriptor oneof)

public SpeechRecognitionAlternative.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
SpeechRecognitionAlternative.Builder
Overrides

clearTranscript()

public SpeechRecognitionAlternative.Builder clearTranscript()

Output-only Transcript text representing the words that the user spoke.

string transcript = 1;

Returns
Type Description
SpeechRecognitionAlternative.Builder

clone()

public SpeechRecognitionAlternative.Builder clone()
Returns
Type Description
SpeechRecognitionAlternative.Builder
Overrides

getConfidence()

public float getConfidence()

Output-only The confidence estimate between 0.0 and 1.0. A higher number indicates an estimated greater likelihood that the recognized words are correct. This field is typically provided only for the top hypothesis, and only for is_final=true results. Clients should not rely on the confidence field as it is not guaranteed to be accurate, or even set, in any of the results. The default of 0.0 is a sentinel value indicating confidence was not set.

float confidence = 2;

Returns
Type Description
float

getDefaultInstanceForType()

public SpeechRecognitionAlternative getDefaultInstanceForType()
Returns
Type Description
SpeechRecognitionAlternative

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
Descriptor
Overrides

getTranscript()

public String getTranscript()

Output-only Transcript text representing the words that the user spoke.

string transcript = 1;

Returns
Type Description
String

getTranscriptBytes()

public ByteString getTranscriptBytes()

Output-only Transcript text representing the words that the user spoke.

string transcript = 1;

Returns
Type Description
ByteString

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(SpeechRecognitionAlternative other)

public SpeechRecognitionAlternative.Builder mergeFrom(SpeechRecognitionAlternative other)
Parameter
Name Description
other SpeechRecognitionAlternative
Returns
Type Description
SpeechRecognitionAlternative.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public SpeechRecognitionAlternative.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
SpeechRecognitionAlternative.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

public SpeechRecognitionAlternative.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
SpeechRecognitionAlternative.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final SpeechRecognitionAlternative.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
SpeechRecognitionAlternative.Builder
Overrides

setConfidence(float value)

public SpeechRecognitionAlternative.Builder setConfidence(float value)

Output-only The confidence estimate between 0.0 and 1.0. A higher number indicates an estimated greater likelihood that the recognized words are correct. This field is typically provided only for the top hypothesis, and only for is_final=true results. Clients should not rely on the confidence field as it is not guaranteed to be accurate, or even set, in any of the results. The default of 0.0 is a sentinel value indicating confidence was not set.

float confidence = 2;

Parameter
Name Description
value float
Returns
Type Description
SpeechRecognitionAlternative.Builder

setField(Descriptors.FieldDescriptor field, Object value)

public SpeechRecognitionAlternative.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
SpeechRecognitionAlternative.Builder
Overrides

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public SpeechRecognitionAlternative.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
SpeechRecognitionAlternative.Builder
Overrides

setTranscript(String value)

public SpeechRecognitionAlternative.Builder setTranscript(String value)

Output-only Transcript text representing the words that the user spoke.

string transcript = 1;

Parameter
Name Description
value String
Returns
Type Description
SpeechRecognitionAlternative.Builder

setTranscriptBytes(ByteString value)

public SpeechRecognitionAlternative.Builder setTranscriptBytes(ByteString value)

Output-only Transcript text representing the words that the user spoke.

string transcript = 1;

Parameter
Name Description
value ByteString
Returns
Type Description
SpeechRecognitionAlternative.Builder

setUnknownFields(UnknownFieldSet unknownFields)

public final SpeechRecognitionAlternative.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
SpeechRecognitionAlternative.Builder
Overrides