Class RecognitionFeatures.Builder

    • Method Detail

      • getDescriptor

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

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

        public 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.GeneratedMessageV3.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.GeneratedMessageV3.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
      • clone

        public RecognitionFeatures.Builder clone()
        Specified by:
        clone in interface com.google.protobuf.Message.Builder
        Specified by:
        clone in interface com.google.protobuf.MessageLite.Builder
        Overrides:
        clone in class com.google.protobuf.GeneratedMessageV3.Builder<RecognitionFeatures.Builder>
      • setField

        public RecognitionFeatures.Builder setField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                                    Object value)
        Specified by:
        setField in interface com.google.protobuf.Message.Builder
        Overrides:
        setField in class com.google.protobuf.GeneratedMessageV3.Builder<RecognitionFeatures.Builder>
      • clearField

        public RecognitionFeatures.Builder clearField​(com.google.protobuf.Descriptors.FieldDescriptor field)
        Specified by:
        clearField in interface com.google.protobuf.Message.Builder
        Overrides:
        clearField in class com.google.protobuf.GeneratedMessageV3.Builder<RecognitionFeatures.Builder>
      • clearOneof

        public RecognitionFeatures.Builder clearOneof​(com.google.protobuf.Descriptors.OneofDescriptor oneof)
        Specified by:
        clearOneof in interface com.google.protobuf.Message.Builder
        Overrides:
        clearOneof in class com.google.protobuf.GeneratedMessageV3.Builder<RecognitionFeatures.Builder>
      • setRepeatedField

        public RecognitionFeatures.Builder setRepeatedField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                                            int index,
                                                            Object value)
        Specified by:
        setRepeatedField in interface com.google.protobuf.Message.Builder
        Overrides:
        setRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<RecognitionFeatures.Builder>
      • addRepeatedField

        public RecognitionFeatures.Builder addRepeatedField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                                            Object value)
        Specified by:
        addRepeatedField in interface com.google.protobuf.Message.Builder
        Overrides:
        addRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<RecognitionFeatures.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>
      • isInitialized

        public final boolean isInitialized()
        Specified by:
        isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
        Overrides:
        isInitialized in class com.google.protobuf.GeneratedMessageV3.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.
      • setMultiChannelMode

        public RecognitionFeatures.Builder setMultiChannelMode​(RecognitionFeatures.MultiChannelMode value)
         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 and set additional
         parameters to make diarization better suited for your application.
         When this is enabled, we send all the words from the beginning of the
         audio for the top alternative in every consecutive STREAMING responses.
         This is done in order to improve our speaker tags as our models learn to
         identify the speakers in the conversation over time.
         For non-streaming requests, the diarization results will be provided only
         in the top alternative of the FINAL SpeechRecognitionResult.
         
        .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 and set additional
         parameters to make diarization better suited for your application.
         When this is enabled, we send all the words from the beginning of the
         audio for the top alternative in every consecutive STREAMING responses.
         This is done in order to improve our speaker tags as our models learn to
         identify the speakers in the conversation over time.
         For non-streaming requests, the diarization results will be provided only
         in the top alternative of the FINAL SpeechRecognitionResult.
         
        .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 and set additional
         parameters to make diarization better suited for your application.
         When this is enabled, we send all the words from the beginning of the
         audio for the top alternative in every consecutive STREAMING responses.
         This is done in order to improve our speaker tags as our models learn to
         identify the speakers in the conversation over time.
         For non-streaming requests, the diarization results will be provided only
         in the top alternative of the FINAL SpeechRecognitionResult.
         
        .google.cloud.speech.v2.SpeakerDiarizationConfig diarization_config = 9;
      • setDiarizationConfig

        public RecognitionFeatures.Builder setDiarizationConfig​(SpeakerDiarizationConfig.Builder builderForValue)
         Configuration to enable speaker diarization and set additional
         parameters to make diarization better suited for your application.
         When this is enabled, we send all the words from the beginning of the
         audio for the top alternative in every consecutive STREAMING responses.
         This is done in order to improve our speaker tags as our models learn to
         identify the speakers in the conversation over time.
         For non-streaming requests, the diarization results will be provided only
         in the top alternative of the FINAL SpeechRecognitionResult.
         
        .google.cloud.speech.v2.SpeakerDiarizationConfig diarization_config = 9;
      • mergeDiarizationConfig

        public RecognitionFeatures.Builder mergeDiarizationConfig​(SpeakerDiarizationConfig value)
         Configuration to enable speaker diarization and set additional
         parameters to make diarization better suited for your application.
         When this is enabled, we send all the words from the beginning of the
         audio for the top alternative in every consecutive STREAMING responses.
         This is done in order to improve our speaker tags as our models learn to
         identify the speakers in the conversation over time.
         For non-streaming requests, the diarization results will be provided only
         in the top alternative of the FINAL SpeechRecognitionResult.
         
        .google.cloud.speech.v2.SpeakerDiarizationConfig diarization_config = 9;
      • clearDiarizationConfig

        public RecognitionFeatures.Builder clearDiarizationConfig()
         Configuration to enable speaker diarization and set additional
         parameters to make diarization better suited for your application.
         When this is enabled, we send all the words from the beginning of the
         audio for the top alternative in every consecutive STREAMING responses.
         This is done in order to improve our speaker tags as our models learn to
         identify the speakers in the conversation over time.
         For non-streaming requests, the diarization results will be provided only
         in the top alternative of the FINAL SpeechRecognitionResult.
         
        .google.cloud.speech.v2.SpeakerDiarizationConfig diarization_config = 9;
      • getDiarizationConfigBuilder

        public SpeakerDiarizationConfig.Builder getDiarizationConfigBuilder()
         Configuration to enable speaker diarization and set additional
         parameters to make diarization better suited for your application.
         When this is enabled, we send all the words from the beginning of the
         audio for the top alternative in every consecutive STREAMING responses.
         This is done in order to improve our speaker tags as our models learn to
         identify the speakers in the conversation over time.
         For non-streaming requests, the diarization results will be provided only
         in the top alternative of the FINAL SpeechRecognitionResult.
         
        .google.cloud.speech.v2.SpeakerDiarizationConfig diarization_config = 9;
      • getDiarizationConfigOrBuilder

        public SpeakerDiarizationConfigOrBuilder getDiarizationConfigOrBuilder()
         Configuration to enable speaker diarization and set additional
         parameters to make diarization better suited for your application.
         When this is enabled, we send all the words from the beginning of the
         audio for the top alternative in every consecutive STREAMING responses.
         This is done in order to improve our speaker tags as our models learn to
         identify the speakers in the conversation over time.
         For non-streaming requests, the diarization results will be provided only
         in the top alternative of the FINAL SpeechRecognitionResult.
         
        .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.
      • setUnknownFields

        public final RecognitionFeatures.Builder setUnknownFields​(com.google.protobuf.UnknownFieldSet unknownFields)
        Specified by:
        setUnknownFields in interface com.google.protobuf.Message.Builder
        Overrides:
        setUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<RecognitionFeatures.Builder>
      • mergeUnknownFields

        public final RecognitionFeatures.Builder mergeUnknownFields​(com.google.protobuf.UnknownFieldSet unknownFields)
        Specified by:
        mergeUnknownFields in interface com.google.protobuf.Message.Builder
        Overrides:
        mergeUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<RecognitionFeatures.Builder>