Package com.google.cloud.speech.v2
Class RecognitionFeatures.Builder
java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessage.Builder<RecognitionFeatures.Builder>
com.google.cloud.speech.v2.RecognitionFeatures.Builder
- All Implemented Interfaces:
RecognitionFeaturesOrBuilder,com.google.protobuf.Message.Builder,com.google.protobuf.MessageLite.Builder,com.google.protobuf.MessageLiteOrBuilder,com.google.protobuf.MessageOrBuilder,Cloneable
- Enclosing class:
- RecognitionFeatures
public static final class RecognitionFeatures.Builder
extends com.google.protobuf.GeneratedMessage.Builder<RecognitionFeatures.Builder>
implements RecognitionFeaturesOrBuilder
Available recognition features.Protobuf type
google.cloud.speech.v2.RecognitionFeatures-
Method Summary
Modifier and TypeMethodDescriptionbuild()clear()Optional.Configuration to enable speaker diarization.If `true`, adds punctuation to recognition result hypotheses.The spoken emoji behavior for the call.The spoken punctuation behavior for the call.If `true`, the top result includes a list of words and the confidence for those words.If `true`, the top result includes a list of words and the start and end time offsets (timestamps) for those words.Maximum number of recognition hypotheses to be returned.Mode for recognizing multi-channel audio.If set to `true`, the server will attempt to filter out profanities, replacing all but the initial character in each filtered word with asterisks, for instance, "f***".Optional.Optional.Optional.static final com.google.protobuf.Descriptors.Descriptorcom.google.protobuf.Descriptors.DescriptorConfiguration to enable speaker diarization.Configuration to enable speaker diarization.Configuration to enable speaker diarization.booleanIf `true`, adds punctuation to recognition result hypotheses.booleanThe spoken emoji behavior for the call.booleanThe spoken punctuation behavior for the call.booleanIf `true`, the top result includes a list of words and the confidence for those words.booleanIf `true`, the top result includes a list of words and the start and end time offsets (timestamps) for those words.intMaximum number of recognition hypotheses to be returned.Mode for recognizing multi-channel audio.intMode for recognizing multi-channel audio.booleanIf set to `true`, the server will attempt to filter out profanities, replacing all but the initial character in each filtered word with asterisks, for instance, "f***".booleanOptional.booleanConfiguration to enable speaker diarization.protected com.google.protobuf.GeneratedMessage.FieldAccessorTablefinal booleanOptional.Configuration to enable speaker diarization.mergeFrom(RecognitionFeatures other) mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) mergeFrom(com.google.protobuf.Message other) Optional.setCustomPromptConfig(CustomPromptConfig.Builder builderForValue) Optional.Configuration to enable speaker diarization.setDiarizationConfig(SpeakerDiarizationConfig.Builder builderForValue) Configuration to enable speaker diarization.setEnableAutomaticPunctuation(boolean value) If `true`, adds punctuation to recognition result hypotheses.setEnableSpokenEmojis(boolean value) The spoken emoji behavior for the call.setEnableSpokenPunctuation(boolean value) The spoken punctuation behavior for the call.setEnableWordConfidence(boolean value) If `true`, the top result includes a list of words and the confidence for those words.setEnableWordTimeOffsets(boolean value) If `true`, the top result includes a list of words and the start and end time offsets (timestamps) for those words.setMaxAlternatives(int value) Maximum number of recognition hypotheses to be returned.Mode for recognizing multi-channel audio.setMultiChannelModeValue(int value) Mode for recognizing multi-channel audio.setProfanityFilter(boolean value) If set to `true`, the server will attempt to filter out profanities, replacing all but the initial character in each filtered word with asterisks, for instance, "f***".Methods inherited from class com.google.protobuf.GeneratedMessage.Builder
addRepeatedField, clearField, clearOneof, clone, getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, getUnknownFieldSetBuilder, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, internalGetMutableMapField, internalGetMutableMapFieldReflection, isClean, markClean, mergeUnknownFields, mergeUnknownLengthDelimitedField, mergeUnknownVarintField, newBuilderForField, onBuilt, onChanged, parseUnknownField, setField, setRepeatedField, setUnknownFields, setUnknownFieldSetBuilder, setUnknownFieldsProto3Methods inherited from class com.google.protobuf.AbstractMessage.Builder
findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toStringMethods inherited from class com.google.protobuf.AbstractMessageLite.Builder
addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, newUninitializedMessageExceptionMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.google.protobuf.Message.Builder
mergeDelimitedFrom, mergeDelimitedFromMethods inherited from interface com.google.protobuf.MessageLite.Builder
mergeFromMethods inherited from interface com.google.protobuf.MessageOrBuilder
findInitializationErrors, getAllFields, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
-
Method Details
-
getDescriptor
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() -
internalGetFieldAccessorTable
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()- Specified by:
internalGetFieldAccessorTablein classcom.google.protobuf.GeneratedMessage.Builder<RecognitionFeatures.Builder>
-
clear
- Specified by:
clearin interfacecom.google.protobuf.Message.Builder- Specified by:
clearin interfacecom.google.protobuf.MessageLite.Builder- Overrides:
clearin classcom.google.protobuf.GeneratedMessage.Builder<RecognitionFeatures.Builder>
-
getDescriptorForType
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()- Specified by:
getDescriptorForTypein interfacecom.google.protobuf.Message.Builder- Specified by:
getDescriptorForTypein interfacecom.google.protobuf.MessageOrBuilder- Overrides:
getDescriptorForTypein classcom.google.protobuf.GeneratedMessage.Builder<RecognitionFeatures.Builder>
-
getDefaultInstanceForType
- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageLiteOrBuilder- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageOrBuilder
-
build
- Specified by:
buildin interfacecom.google.protobuf.Message.Builder- Specified by:
buildin interfacecom.google.protobuf.MessageLite.Builder
-
buildPartial
- Specified by:
buildPartialin interfacecom.google.protobuf.Message.Builder- Specified by:
buildPartialin interfacecom.google.protobuf.MessageLite.Builder
-
mergeFrom
- Specified by:
mergeFromin interfacecom.google.protobuf.Message.Builder- Overrides:
mergeFromin classcom.google.protobuf.AbstractMessage.Builder<RecognitionFeatures.Builder>
-
mergeFrom
-
isInitialized
public final boolean isInitialized()- Specified by:
isInitializedin interfacecom.google.protobuf.MessageLiteOrBuilder- Overrides:
isInitializedin classcom.google.protobuf.GeneratedMessage.Builder<RecognitionFeatures.Builder>
-
mergeFrom
public RecognitionFeatures.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Specified by:
mergeFromin interfacecom.google.protobuf.Message.Builder- Specified by:
mergeFromin interfacecom.google.protobuf.MessageLite.Builder- Overrides:
mergeFromin classcom.google.protobuf.AbstractMessage.Builder<RecognitionFeatures.Builder>- Throws:
IOException
-
getProfanityFilter
public boolean getProfanityFilter()If set to `true`, the server will attempt to filter out profanities, replacing all but the initial character in each filtered word with asterisks, for instance, "f***". If set to `false` or omitted, profanities won't be filtered out.
bool profanity_filter = 1;- Specified by:
getProfanityFilterin interfaceRecognitionFeaturesOrBuilder- Returns:
- The profanityFilter.
-
setProfanityFilter
If set to `true`, the server will attempt to filter out profanities, replacing all but the initial character in each filtered word with asterisks, for instance, "f***". If set to `false` or omitted, profanities won't be filtered out.
bool profanity_filter = 1;- Parameters:
value- The profanityFilter to set.- Returns:
- This builder for chaining.
-
clearProfanityFilter
If set to `true`, the server will attempt to filter out profanities, replacing all but the initial character in each filtered word with asterisks, for instance, "f***". If set to `false` or omitted, profanities won't be filtered out.
bool profanity_filter = 1;- Returns:
- This builder for chaining.
-
getEnableWordTimeOffsets
public boolean getEnableWordTimeOffsets()If `true`, the top result includes a list of words and the start and end time offsets (timestamps) for those words. If `false`, no word-level time offset information is returned. The default is `false`.
bool enable_word_time_offsets = 2;- Specified by:
getEnableWordTimeOffsetsin interfaceRecognitionFeaturesOrBuilder- Returns:
- The enableWordTimeOffsets.
-
setEnableWordTimeOffsets
If `true`, the top result includes a list of words and the start and end time offsets (timestamps) for those words. If `false`, no word-level time offset information is returned. The default is `false`.
bool enable_word_time_offsets = 2;- Parameters:
value- The enableWordTimeOffsets to set.- Returns:
- This builder for chaining.
-
clearEnableWordTimeOffsets
If `true`, the top result includes a list of words and the start and end time offsets (timestamps) for those words. If `false`, no word-level time offset information is returned. The default is `false`.
bool enable_word_time_offsets = 2;- Returns:
- This builder for chaining.
-
getEnableWordConfidence
public boolean getEnableWordConfidence()If `true`, the top result includes a list of words and the confidence for those words. If `false`, no word-level confidence information is returned. The default is `false`.
bool enable_word_confidence = 3;- Specified by:
getEnableWordConfidencein interfaceRecognitionFeaturesOrBuilder- Returns:
- The enableWordConfidence.
-
setEnableWordConfidence
If `true`, the top result includes a list of words and the confidence for those words. If `false`, no word-level confidence information is returned. The default is `false`.
bool enable_word_confidence = 3;- Parameters:
value- The enableWordConfidence to set.- Returns:
- This builder for chaining.
-
clearEnableWordConfidence
If `true`, the top result includes a list of words and the confidence for those words. If `false`, no word-level confidence information is returned. The default is `false`.
bool enable_word_confidence = 3;- Returns:
- This builder for chaining.
-
getEnableAutomaticPunctuation
public boolean getEnableAutomaticPunctuation()If `true`, adds punctuation to recognition result hypotheses. This feature is only available in select languages. The default `false` value does not add punctuation to result hypotheses.
bool enable_automatic_punctuation = 4;- Specified by:
getEnableAutomaticPunctuationin interfaceRecognitionFeaturesOrBuilder- Returns:
- The enableAutomaticPunctuation.
-
setEnableAutomaticPunctuation
If `true`, adds punctuation to recognition result hypotheses. This feature is only available in select languages. The default `false` value does not add punctuation to result hypotheses.
bool enable_automatic_punctuation = 4;- Parameters:
value- The enableAutomaticPunctuation to set.- Returns:
- This builder for chaining.
-
clearEnableAutomaticPunctuation
If `true`, adds punctuation to recognition result hypotheses. This feature is only available in select languages. The default `false` value does not add punctuation to result hypotheses.
bool enable_automatic_punctuation = 4;- Returns:
- This builder for chaining.
-
getEnableSpokenPunctuation
public boolean getEnableSpokenPunctuation()The spoken punctuation behavior for the call. If `true`, replaces spoken punctuation with the corresponding symbols in the request. For example, "how are you question mark" becomes "how are you?". See https://cloud.google.com/speech-to-text/docs/spoken-punctuation for support. If `false`, spoken punctuation is not replaced.
bool enable_spoken_punctuation = 14;- Specified by:
getEnableSpokenPunctuationin interfaceRecognitionFeaturesOrBuilder- Returns:
- The enableSpokenPunctuation.
-
setEnableSpokenPunctuation
The spoken punctuation behavior for the call. If `true`, replaces spoken punctuation with the corresponding symbols in the request. For example, "how are you question mark" becomes "how are you?". See https://cloud.google.com/speech-to-text/docs/spoken-punctuation for support. If `false`, spoken punctuation is not replaced.
bool enable_spoken_punctuation = 14;- Parameters:
value- The enableSpokenPunctuation to set.- Returns:
- This builder for chaining.
-
clearEnableSpokenPunctuation
The spoken punctuation behavior for the call. If `true`, replaces spoken punctuation with the corresponding symbols in the request. For example, "how are you question mark" becomes "how are you?". See https://cloud.google.com/speech-to-text/docs/spoken-punctuation for support. If `false`, spoken punctuation is not replaced.
bool enable_spoken_punctuation = 14;- Returns:
- This builder for chaining.
-
getEnableSpokenEmojis
public boolean getEnableSpokenEmojis()The spoken emoji behavior for the call. If `true`, adds spoken emoji formatting for the request. This will replace spoken emojis with the corresponding Unicode symbols in the final transcript. If `false`, spoken emojis are not replaced.
bool enable_spoken_emojis = 15;- Specified by:
getEnableSpokenEmojisin interfaceRecognitionFeaturesOrBuilder- Returns:
- The enableSpokenEmojis.
-
setEnableSpokenEmojis
The spoken emoji behavior for the call. If `true`, adds spoken emoji formatting for the request. This will replace spoken emojis with the corresponding Unicode symbols in the final transcript. If `false`, spoken emojis are not replaced.
bool enable_spoken_emojis = 15;- Parameters:
value- The enableSpokenEmojis to set.- Returns:
- This builder for chaining.
-
clearEnableSpokenEmojis
The spoken emoji behavior for the call. If `true`, adds spoken emoji formatting for the request. This will replace spoken emojis with the corresponding Unicode symbols in the final transcript. If `false`, spoken emojis are not replaced.
bool enable_spoken_emojis = 15;- Returns:
- This builder for chaining.
-
getMultiChannelModeValue
public int getMultiChannelModeValue()Mode for recognizing multi-channel audio.
.google.cloud.speech.v2.RecognitionFeatures.MultiChannelMode multi_channel_mode = 17;- Specified by:
getMultiChannelModeValuein interfaceRecognitionFeaturesOrBuilder- Returns:
- The enum numeric value on the wire for multiChannelMode.
-
setMultiChannelModeValue
Mode for recognizing multi-channel audio.
.google.cloud.speech.v2.RecognitionFeatures.MultiChannelMode multi_channel_mode = 17;- Parameters:
value- The enum numeric value on the wire for multiChannelMode to set.- Returns:
- This builder for chaining.
-
getMultiChannelMode
Mode for recognizing multi-channel audio.
.google.cloud.speech.v2.RecognitionFeatures.MultiChannelMode multi_channel_mode = 17;- Specified by:
getMultiChannelModein interfaceRecognitionFeaturesOrBuilder- Returns:
- The multiChannelMode.
-
setMultiChannelMode
Mode for recognizing multi-channel audio.
.google.cloud.speech.v2.RecognitionFeatures.MultiChannelMode multi_channel_mode = 17;- Parameters:
value- The multiChannelMode to set.- Returns:
- This builder for chaining.
-
clearMultiChannelMode
Mode for recognizing multi-channel audio.
.google.cloud.speech.v2.RecognitionFeatures.MultiChannelMode multi_channel_mode = 17;- Returns:
- This builder for chaining.
-
hasDiarizationConfig
public boolean hasDiarizationConfig()Configuration to enable speaker diarization. To enable diarization, set this field to an empty SpeakerDiarizationConfig message.
.google.cloud.speech.v2.SpeakerDiarizationConfig diarization_config = 9;- Specified by:
hasDiarizationConfigin interfaceRecognitionFeaturesOrBuilder- Returns:
- Whether the diarizationConfig field is set.
-
getDiarizationConfig
Configuration to enable speaker diarization. To enable diarization, set this field to an empty SpeakerDiarizationConfig message.
.google.cloud.speech.v2.SpeakerDiarizationConfig diarization_config = 9;- Specified by:
getDiarizationConfigin interfaceRecognitionFeaturesOrBuilder- Returns:
- The diarizationConfig.
-
setDiarizationConfig
Configuration to enable speaker diarization. To enable diarization, set this field to an empty SpeakerDiarizationConfig message.
.google.cloud.speech.v2.SpeakerDiarizationConfig diarization_config = 9; -
setDiarizationConfig
public RecognitionFeatures.Builder setDiarizationConfig(SpeakerDiarizationConfig.Builder builderForValue) Configuration to enable speaker diarization. To enable diarization, set this field to an empty SpeakerDiarizationConfig message.
.google.cloud.speech.v2.SpeakerDiarizationConfig diarization_config = 9; -
mergeDiarizationConfig
Configuration to enable speaker diarization. To enable diarization, set this field to an empty SpeakerDiarizationConfig message.
.google.cloud.speech.v2.SpeakerDiarizationConfig diarization_config = 9; -
clearDiarizationConfig
Configuration to enable speaker diarization. To enable diarization, set this field to an empty SpeakerDiarizationConfig message.
.google.cloud.speech.v2.SpeakerDiarizationConfig diarization_config = 9; -
getDiarizationConfigBuilder
Configuration to enable speaker diarization. To enable diarization, set this field to an empty SpeakerDiarizationConfig message.
.google.cloud.speech.v2.SpeakerDiarizationConfig diarization_config = 9; -
getDiarizationConfigOrBuilder
Configuration to enable speaker diarization. To enable diarization, set this field to an empty SpeakerDiarizationConfig message.
.google.cloud.speech.v2.SpeakerDiarizationConfig diarization_config = 9;- Specified by:
getDiarizationConfigOrBuilderin interfaceRecognitionFeaturesOrBuilder
-
getMaxAlternatives
public int getMaxAlternatives()Maximum number of recognition hypotheses to be returned. The server may return fewer than `max_alternatives`. Valid values are `0`-`30`. A value of `0` or `1` will return a maximum of one. If omitted, will return a maximum of one.
int32 max_alternatives = 16;- Specified by:
getMaxAlternativesin interfaceRecognitionFeaturesOrBuilder- Returns:
- The maxAlternatives.
-
setMaxAlternatives
Maximum number of recognition hypotheses to be returned. The server may return fewer than `max_alternatives`. Valid values are `0`-`30`. A value of `0` or `1` will return a maximum of one. If omitted, will return a maximum of one.
int32 max_alternatives = 16;- Parameters:
value- The maxAlternatives to set.- Returns:
- This builder for chaining.
-
clearMaxAlternatives
Maximum number of recognition hypotheses to be returned. The server may return fewer than `max_alternatives`. Valid values are `0`-`30`. A value of `0` or `1` will return a maximum of one. If omitted, will return a maximum of one.
int32 max_alternatives = 16;- Returns:
- This builder for chaining.
-
hasCustomPromptConfig
public boolean hasCustomPromptConfig()Optional. Configuration to enable custom prompt for chirp3.
.google.cloud.speech.v2.CustomPromptConfig custom_prompt_config = 18 [(.google.api.field_behavior) = OPTIONAL];- Specified by:
hasCustomPromptConfigin interfaceRecognitionFeaturesOrBuilder- Returns:
- Whether the customPromptConfig field is set.
-
getCustomPromptConfig
Optional. Configuration to enable custom prompt for chirp3.
.google.cloud.speech.v2.CustomPromptConfig custom_prompt_config = 18 [(.google.api.field_behavior) = OPTIONAL];- Specified by:
getCustomPromptConfigin interfaceRecognitionFeaturesOrBuilder- Returns:
- The customPromptConfig.
-
setCustomPromptConfig
Optional. Configuration to enable custom prompt for chirp3.
.google.cloud.speech.v2.CustomPromptConfig custom_prompt_config = 18 [(.google.api.field_behavior) = OPTIONAL]; -
setCustomPromptConfig
public RecognitionFeatures.Builder setCustomPromptConfig(CustomPromptConfig.Builder builderForValue) Optional. Configuration to enable custom prompt for chirp3.
.google.cloud.speech.v2.CustomPromptConfig custom_prompt_config = 18 [(.google.api.field_behavior) = OPTIONAL]; -
mergeCustomPromptConfig
Optional. Configuration to enable custom prompt for chirp3.
.google.cloud.speech.v2.CustomPromptConfig custom_prompt_config = 18 [(.google.api.field_behavior) = OPTIONAL]; -
clearCustomPromptConfig
Optional. Configuration to enable custom prompt for chirp3.
.google.cloud.speech.v2.CustomPromptConfig custom_prompt_config = 18 [(.google.api.field_behavior) = OPTIONAL]; -
getCustomPromptConfigBuilder
Optional. Configuration to enable custom prompt for chirp3.
.google.cloud.speech.v2.CustomPromptConfig custom_prompt_config = 18 [(.google.api.field_behavior) = OPTIONAL]; -
getCustomPromptConfigOrBuilder
Optional. Configuration to enable custom prompt for chirp3.
.google.cloud.speech.v2.CustomPromptConfig custom_prompt_config = 18 [(.google.api.field_behavior) = OPTIONAL];- Specified by:
getCustomPromptConfigOrBuilderin interfaceRecognitionFeaturesOrBuilder
-