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 Details

    • getDescriptor

      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
    • internalGetFieldAccessorTable

      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
      Specified by:
      internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessage.Builder<RecognitionFeatures.Builder>
    • clear

      Specified by:
      clear in interface com.google.protobuf.Message.Builder
      Specified by:
      clear in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      clear in class com.google.protobuf.GeneratedMessage.Builder<RecognitionFeatures.Builder>
    • getDescriptorForType

      public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
      Specified by:
      getDescriptorForType in interface com.google.protobuf.Message.Builder
      Specified by:
      getDescriptorForType in interface com.google.protobuf.MessageOrBuilder
      Overrides:
      getDescriptorForType in class com.google.protobuf.GeneratedMessage.Builder<RecognitionFeatures.Builder>
    • getDefaultInstanceForType

      public RecognitionFeatures getDefaultInstanceForType()
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder
    • build

      public RecognitionFeatures build()
      Specified by:
      build in interface com.google.protobuf.Message.Builder
      Specified by:
      build in interface com.google.protobuf.MessageLite.Builder
    • buildPartial

      public RecognitionFeatures buildPartial()
      Specified by:
      buildPartial in interface com.google.protobuf.Message.Builder
      Specified by:
      buildPartial in interface com.google.protobuf.MessageLite.Builder
    • mergeFrom

      public RecognitionFeatures.Builder mergeFrom(com.google.protobuf.Message other)
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<RecognitionFeatures.Builder>
    • mergeFrom

    • isInitialized

      public final boolean isInitialized()
      Specified by:
      isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
      Overrides:
      isInitialized in class com.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:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Specified by:
      mergeFrom in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      mergeFrom in class com.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:
      getProfanityFilter in interface RecognitionFeaturesOrBuilder
      Returns:
      The profanityFilter.
    • setProfanityFilter

      public RecognitionFeatures.Builder 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***". 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

      public RecognitionFeatures.Builder 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:
      getEnableWordTimeOffsets in interface RecognitionFeaturesOrBuilder
      Returns:
      The enableWordTimeOffsets.
    • setEnableWordTimeOffsets

      public RecognitionFeatures.Builder setEnableWordTimeOffsets(boolean value)
       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

      public RecognitionFeatures.Builder 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:
      getEnableWordConfidence in interface RecognitionFeaturesOrBuilder
      Returns:
      The enableWordConfidence.
    • setEnableWordConfidence

      public RecognitionFeatures.Builder setEnableWordConfidence(boolean value)
       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

      public RecognitionFeatures.Builder 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:
      getEnableAutomaticPunctuation in interface RecognitionFeaturesOrBuilder
      Returns:
      The enableAutomaticPunctuation.
    • setEnableAutomaticPunctuation

      public RecognitionFeatures.Builder setEnableAutomaticPunctuation(boolean value)
       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

      public RecognitionFeatures.Builder 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:
      getEnableSpokenPunctuation in interface RecognitionFeaturesOrBuilder
      Returns:
      The enableSpokenPunctuation.
    • setEnableSpokenPunctuation

      public RecognitionFeatures.Builder setEnableSpokenPunctuation(boolean value)
       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

      public RecognitionFeatures.Builder 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:
      getEnableSpokenEmojis in interface RecognitionFeaturesOrBuilder
      Returns:
      The enableSpokenEmojis.
    • setEnableSpokenEmojis

      public RecognitionFeatures.Builder setEnableSpokenEmojis(boolean value)
       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

      public RecognitionFeatures.Builder 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:
      getMultiChannelModeValue in interface RecognitionFeaturesOrBuilder
      Returns:
      The enum numeric value on the wire for multiChannelMode.
    • setMultiChannelModeValue

      public RecognitionFeatures.Builder setMultiChannelModeValue(int value)
       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

      public RecognitionFeatures.MultiChannelMode getMultiChannelMode()
       Mode for recognizing multi-channel audio.
       
      .google.cloud.speech.v2.RecognitionFeatures.MultiChannelMode multi_channel_mode = 17;
      Specified by:
      getMultiChannelMode in interface RecognitionFeaturesOrBuilder
      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

      public RecognitionFeatures.Builder 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:
      hasDiarizationConfig in interface RecognitionFeaturesOrBuilder
      Returns:
      Whether the diarizationConfig field is set.
    • getDiarizationConfig

      public SpeakerDiarizationConfig 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:
      getDiarizationConfig in interface RecognitionFeaturesOrBuilder
      Returns:
      The diarizationConfig.
    • setDiarizationConfig

      public RecognitionFeatures.Builder setDiarizationConfig(SpeakerDiarizationConfig value)
       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

      public RecognitionFeatures.Builder mergeDiarizationConfig(SpeakerDiarizationConfig value)
       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

      public RecognitionFeatures.Builder 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

      public SpeakerDiarizationConfig.Builder 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

      public SpeakerDiarizationConfigOrBuilder 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:
      getDiarizationConfigOrBuilder in interface RecognitionFeaturesOrBuilder
    • 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:
      getMaxAlternatives in interface RecognitionFeaturesOrBuilder
      Returns:
      The maxAlternatives.
    • setMaxAlternatives

      public RecognitionFeatures.Builder setMaxAlternatives(int value)
       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

      public RecognitionFeatures.Builder 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:
      hasCustomPromptConfig in interface RecognitionFeaturesOrBuilder
      Returns:
      Whether the customPromptConfig field is set.
    • getCustomPromptConfig

      public CustomPromptConfig 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:
      getCustomPromptConfig in interface RecognitionFeaturesOrBuilder
      Returns:
      The customPromptConfig.
    • setCustomPromptConfig

      public RecognitionFeatures.Builder setCustomPromptConfig(CustomPromptConfig value)
       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

      public RecognitionFeatures.Builder mergeCustomPromptConfig(CustomPromptConfig value)
       Optional. Configuration to enable custom prompt for chirp3.
       
      .google.cloud.speech.v2.CustomPromptConfig custom_prompt_config = 18 [(.google.api.field_behavior) = OPTIONAL];
    • clearCustomPromptConfig

      public RecognitionFeatures.Builder clearCustomPromptConfig()
       Optional. Configuration to enable custom prompt for chirp3.
       
      .google.cloud.speech.v2.CustomPromptConfig custom_prompt_config = 18 [(.google.api.field_behavior) = OPTIONAL];
    • getCustomPromptConfigBuilder

      public CustomPromptConfig.Builder getCustomPromptConfigBuilder()
       Optional. Configuration to enable custom prompt for chirp3.
       
      .google.cloud.speech.v2.CustomPromptConfig custom_prompt_config = 18 [(.google.api.field_behavior) = OPTIONAL];
    • getCustomPromptConfigOrBuilder

      public CustomPromptConfigOrBuilder 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:
      getCustomPromptConfigOrBuilder in interface RecognitionFeaturesOrBuilder