Class PhraseSet.Builder (2.5.1)

public static final class PhraseSet.Builder extends GeneratedMessageV3.Builder<PhraseSet.Builder> implements PhraseSetOrBuilder

Provides "hints" to the speech recognizer to favor specific words and phrases in the results.

Protobuf type google.cloud.speech.v1p1beta1.PhraseSet

Implements

PhraseSetOrBuilder

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

Methods

addAllPhrases(Iterable<? extends PhraseSet.Phrase> values)

public PhraseSet.Builder addAllPhrases(Iterable<? extends PhraseSet.Phrase> values)

A list of word and phrases.

repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2;

Parameter
NameDescription
valuesIterable<? extends com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase>
Returns
TypeDescription
PhraseSet.Builder

addPhrases(PhraseSet.Phrase value)

public PhraseSet.Builder addPhrases(PhraseSet.Phrase value)

A list of word and phrases.

repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2;

Parameter
NameDescription
valuePhraseSet.Phrase
Returns
TypeDescription
PhraseSet.Builder

addPhrases(PhraseSet.Phrase.Builder builderForValue)

public PhraseSet.Builder addPhrases(PhraseSet.Phrase.Builder builderForValue)

A list of word and phrases.

repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2;

Parameter
NameDescription
builderForValuePhraseSet.Phrase.Builder
Returns
TypeDescription
PhraseSet.Builder

addPhrases(int index, PhraseSet.Phrase value)

public PhraseSet.Builder addPhrases(int index, PhraseSet.Phrase value)

A list of word and phrases.

repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2;

Parameters
NameDescription
indexint
valuePhraseSet.Phrase
Returns
TypeDescription
PhraseSet.Builder

addPhrases(int index, PhraseSet.Phrase.Builder builderForValue)

public PhraseSet.Builder addPhrases(int index, PhraseSet.Phrase.Builder builderForValue)

A list of word and phrases.

repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2;

Parameters
NameDescription
indexint
builderForValuePhraseSet.Phrase.Builder
Returns
TypeDescription
PhraseSet.Builder

addPhrasesBuilder()

public PhraseSet.Phrase.Builder addPhrasesBuilder()

A list of word and phrases.

repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2;

Returns
TypeDescription
PhraseSet.Phrase.Builder

addPhrasesBuilder(int index)

public PhraseSet.Phrase.Builder addPhrasesBuilder(int index)

A list of word and phrases.

repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2;

Parameter
NameDescription
indexint
Returns
TypeDescription
PhraseSet.Phrase.Builder

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public PhraseSet.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
PhraseSet.Builder
Overrides

build()

public PhraseSet build()
Returns
TypeDescription
PhraseSet

buildPartial()

public PhraseSet buildPartial()
Returns
TypeDescription
PhraseSet

clear()

public PhraseSet.Builder clear()
Returns
TypeDescription
PhraseSet.Builder
Overrides

clearBoost()

public PhraseSet.Builder clearBoost()

Hint Boost. Positive value will increase the probability that a specific phrase will be recognized over other similar sounding phrases. The higher the boost, the higher the chance of false positive recognition as well. Negative boost values would correspond to anti-biasing. Anti-biasing is not enabled, so negative boost will simply be ignored. Though boost can accept a wide range of positive values, most use cases are best served with values between 0 (exclusive) and 20. We recommend using a binary search approach to finding the optimal value for your use case. Speech recognition will skip PhraseSets with a boost value of 0.

float boost = 4;

Returns
TypeDescription
PhraseSet.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public PhraseSet.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
PhraseSet.Builder
Overrides

clearName()

public PhraseSet.Builder clearName()

The resource name of the phrase set.

string name = 1;

Returns
TypeDescription
PhraseSet.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public PhraseSet.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
PhraseSet.Builder
Overrides

clearPhrases()

public PhraseSet.Builder clearPhrases()

A list of word and phrases.

repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2;

Returns
TypeDescription
PhraseSet.Builder

clone()

public PhraseSet.Builder clone()
Returns
TypeDescription
PhraseSet.Builder
Overrides

getBoost()

public float getBoost()

Hint Boost. Positive value will increase the probability that a specific phrase will be recognized over other similar sounding phrases. The higher the boost, the higher the chance of false positive recognition as well. Negative boost values would correspond to anti-biasing. Anti-biasing is not enabled, so negative boost will simply be ignored. Though boost can accept a wide range of positive values, most use cases are best served with values between 0 (exclusive) and 20. We recommend using a binary search approach to finding the optimal value for your use case. Speech recognition will skip PhraseSets with a boost value of 0.

float boost = 4;

Returns
TypeDescription
float

The boost.

getDefaultInstanceForType()

public PhraseSet getDefaultInstanceForType()
Returns
TypeDescription
PhraseSet

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getName()

public String getName()

The resource name of the phrase set.

string name = 1;

Returns
TypeDescription
String

The name.

getNameBytes()

public ByteString getNameBytes()

The resource name of the phrase set.

string name = 1;

Returns
TypeDescription
ByteString

The bytes for name.

getPhrases(int index)

public PhraseSet.Phrase getPhrases(int index)

A list of word and phrases.

repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2;

Parameter
NameDescription
indexint
Returns
TypeDescription
PhraseSet.Phrase

getPhrasesBuilder(int index)

public PhraseSet.Phrase.Builder getPhrasesBuilder(int index)

A list of word and phrases.

repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2;

Parameter
NameDescription
indexint
Returns
TypeDescription
PhraseSet.Phrase.Builder

getPhrasesBuilderList()

public List<PhraseSet.Phrase.Builder> getPhrasesBuilderList()

A list of word and phrases.

repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2;

Returns
TypeDescription
List<Builder>

getPhrasesCount()

public int getPhrasesCount()

A list of word and phrases.

repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2;

Returns
TypeDescription
int

getPhrasesList()

public List<PhraseSet.Phrase> getPhrasesList()

A list of word and phrases.

repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2;

Returns
TypeDescription
List<Phrase>

getPhrasesOrBuilder(int index)

public PhraseSet.PhraseOrBuilder getPhrasesOrBuilder(int index)

A list of word and phrases.

repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2;

Parameter
NameDescription
indexint
Returns
TypeDescription
PhraseSet.PhraseOrBuilder

getPhrasesOrBuilderList()

public List<? extends PhraseSet.PhraseOrBuilder> getPhrasesOrBuilderList()

A list of word and phrases.

repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2;

Returns
TypeDescription
List<? extends com.google.cloud.speech.v1p1beta1.PhraseSet.PhraseOrBuilder>

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(PhraseSet other)

public PhraseSet.Builder mergeFrom(PhraseSet other)
Parameter
NameDescription
otherPhraseSet
Returns
TypeDescription
PhraseSet.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public PhraseSet.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
PhraseSet.Builder
Overrides Exceptions
TypeDescription
IOException

mergeFrom(Message other)

public PhraseSet.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
PhraseSet.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final PhraseSet.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
PhraseSet.Builder
Overrides

removePhrases(int index)

public PhraseSet.Builder removePhrases(int index)

A list of word and phrases.

repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2;

Parameter
NameDescription
indexint
Returns
TypeDescription
PhraseSet.Builder

setBoost(float value)

public PhraseSet.Builder setBoost(float value)

Hint Boost. Positive value will increase the probability that a specific phrase will be recognized over other similar sounding phrases. The higher the boost, the higher the chance of false positive recognition as well. Negative boost values would correspond to anti-biasing. Anti-biasing is not enabled, so negative boost will simply be ignored. Though boost can accept a wide range of positive values, most use cases are best served with values between 0 (exclusive) and 20. We recommend using a binary search approach to finding the optimal value for your use case. Speech recognition will skip PhraseSets with a boost value of 0.

float boost = 4;

Parameter
NameDescription
valuefloat

The boost to set.

Returns
TypeDescription
PhraseSet.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

public PhraseSet.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
PhraseSet.Builder
Overrides

setName(String value)

public PhraseSet.Builder setName(String value)

The resource name of the phrase set.

string name = 1;

Parameter
NameDescription
valueString

The name to set.

Returns
TypeDescription
PhraseSet.Builder

This builder for chaining.

setNameBytes(ByteString value)

public PhraseSet.Builder setNameBytes(ByteString value)

The resource name of the phrase set.

string name = 1;

Parameter
NameDescription
valueByteString

The bytes for name to set.

Returns
TypeDescription
PhraseSet.Builder

This builder for chaining.

setPhrases(int index, PhraseSet.Phrase value)

public PhraseSet.Builder setPhrases(int index, PhraseSet.Phrase value)

A list of word and phrases.

repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2;

Parameters
NameDescription
indexint
valuePhraseSet.Phrase
Returns
TypeDescription
PhraseSet.Builder

setPhrases(int index, PhraseSet.Phrase.Builder builderForValue)

public PhraseSet.Builder setPhrases(int index, PhraseSet.Phrase.Builder builderForValue)

A list of word and phrases.

repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2;

Parameters
NameDescription
indexint
builderForValuePhraseSet.Phrase.Builder
Returns
TypeDescription
PhraseSet.Builder

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

public PhraseSet.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
PhraseSet.Builder
Overrides

setUnknownFields(UnknownFieldSet unknownFields)

public final PhraseSet.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
PhraseSet.Builder
Overrides