Class PhraseSet.Builder (4.49.0)

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
Type Description
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
Name Description
values Iterable<? extends com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase>
Returns
Type Description
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
Name Description
value PhraseSet.Phrase
Returns
Type Description
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
Name Description
builderForValue PhraseSet.Phrase.Builder
Returns
Type Description
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
Name Description
index int
value PhraseSet.Phrase
Returns
Type Description
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
Name Description
index int
builderForValue PhraseSet.Phrase.Builder
Returns
Type Description
PhraseSet.Builder

addPhrasesBuilder()

public PhraseSet.Phrase.Builder addPhrasesBuilder()

A list of word and phrases.

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

Returns
Type Description
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
Name Description
index int
Returns
Type Description
PhraseSet.Phrase.Builder

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

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

build()

public PhraseSet build()
Returns
Type Description
PhraseSet

buildPartial()

public PhraseSet buildPartial()
Returns
Type Description
PhraseSet

clear()

public PhraseSet.Builder clear()
Returns
Type Description
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 as well as adding phrases both with and without boost to your requests.

float boost = 4;

Returns
Type Description
PhraseSet.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

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

clearName()

public PhraseSet.Builder clearName()

The resource name of the phrase set.

string name = 1;

Returns
Type Description
PhraseSet.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

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

clearPhrases()

public PhraseSet.Builder clearPhrases()

A list of word and phrases.

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

Returns
Type Description
PhraseSet.Builder

clone()

public PhraseSet.Builder clone()
Returns
Type Description
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 as well as adding phrases both with and without boost to your requests.

float boost = 4;

Returns
Type Description
float

The boost.

getDefaultInstanceForType()

public PhraseSet getDefaultInstanceForType()
Returns
Type Description
PhraseSet

getDescriptorForType()

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

getName()

public String getName()

The resource name of the phrase set.

string name = 1;

Returns
Type Description
String

The name.

getNameBytes()

public ByteString getNameBytes()

The resource name of the phrase set.

string name = 1;

Returns
Type Description
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
Name Description
index int
Returns
Type Description
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
Name Description
index int
Returns
Type Description
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
Type Description
List<Builder>

getPhrasesCount()

public int getPhrasesCount()

A list of word and phrases.

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

Returns
Type Description
int

getPhrasesList()

public List<PhraseSet.Phrase> getPhrasesList()

A list of word and phrases.

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

Returns
Type Description
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
Name Description
index int
Returns
Type Description
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
Type Description
List<? extends com.google.cloud.speech.v1p1beta1.PhraseSet.PhraseOrBuilder>

internalGetFieldAccessorTable()

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

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(PhraseSet other)

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

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

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

mergeUnknownFields(UnknownFieldSet unknownFields)

public final PhraseSet.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
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
Name Description
index int
Returns
Type Description
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 as well as adding phrases both with and without boost to your requests.

float boost = 4;

Parameter
Name Description
value float

The boost to set.

Returns
Type Description
PhraseSet.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

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

setName(String value)

public PhraseSet.Builder setName(String value)

The resource name of the phrase set.

string name = 1;

Parameter
Name Description
value String

The name to set.

Returns
Type Description
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
Name Description
value ByteString

The bytes for name to set.

Returns
Type Description
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
Name Description
index int
value PhraseSet.Phrase
Returns
Type Description
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
Name Description
index int
builderForValue PhraseSet.Phrase.Builder
Returns
Type Description
PhraseSet.Builder

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

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

setUnknownFields(UnknownFieldSet unknownFields)

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