diff --git a/java-speech/google-cloud-speech/src/main/resources/META-INF/native-image/com.google.cloud.speech.v1/reflect-config.json b/java-speech/google-cloud-speech/src/main/resources/META-INF/native-image/com.google.cloud.speech.v1/reflect-config.json index a7bff84b5c16..5302d6a21dc2 100644 --- a/java-speech/google-cloud-speech/src/main/resources/META-INF/native-image/com.google.cloud.speech.v1/reflect-config.json +++ b/java-speech/google-cloud-speech/src/main/resources/META-INF/native-image/com.google.cloud.speech.v1/reflect-config.json @@ -1043,6 +1043,42 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.cloud.speech.v1.TranscriptNormalization", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.speech.v1.TranscriptNormalization$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.speech.v1.TranscriptNormalization$Entry", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.speech.v1.TranscriptNormalization$Entry$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.cloud.speech.v1.TranscriptOutputConfig", "queryAllDeclaredConstructors": true, diff --git a/java-speech/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognitionConfig.java b/java-speech/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognitionConfig.java index d6e278a01b91..db992ce1942f 100644 --- a/java-speech/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognitionConfig.java +++ b/java-speech/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognitionConfig.java @@ -199,6 +199,19 @@ public enum AudioEncoding implements com.google.protobuf.ProtocolMessageEnum { * SPEEX_WITH_HEADER_BYTE = 7; */ SPEEX_WITH_HEADER_BYTE(7), + /** + * + * + *
+     * MP3 audio. MP3 encoding is a Beta feature and only available in
+     * v1p1beta1. Support all standard MP3 bitrates (which range from 32-320
+     * kbps). When using this encoding, `sample_rate_hertz` has to match the
+     * sample rate of the file being used.
+     * 
+ * + * MP3 = 8; + */ + MP3(8), /** * * @@ -313,6 +326,19 @@ public enum AudioEncoding implements com.google.protobuf.ProtocolMessageEnum { * SPEEX_WITH_HEADER_BYTE = 7; */ public static final int SPEEX_WITH_HEADER_BYTE_VALUE = 7; + /** + * + * + *
+     * MP3 audio. MP3 encoding is a Beta feature and only available in
+     * v1p1beta1. Support all standard MP3 bitrates (which range from 32-320
+     * kbps). When using this encoding, `sample_rate_hertz` has to match the
+     * sample rate of the file being used.
+     * 
+ * + * MP3 = 8; + */ + public static final int MP3_VALUE = 8; /** * * @@ -366,6 +392,8 @@ public static AudioEncoding forNumber(int value) { return OGG_OPUS; case 7: return SPEEX_WITH_HEADER_BYTE; + case 8: + return MP3; case 9: return WEBM_OPUS; default: @@ -812,6 +840,72 @@ public com.google.cloud.speech.v1.SpeechAdaptationOrBuilder getAdaptationOrBuild : adaptation_; } + public static final int TRANSCRIPT_NORMALIZATION_FIELD_NUMBER = 24; + private com.google.cloud.speech.v1.TranscriptNormalization transcriptNormalization_; + /** + * + * + *
+   * Optional. Use transcription normalization to automatically replace parts of
+   * the transcript with phrases of your choosing. For StreamingRecognize, this
+   * normalization only applies to stable partial transcripts (stability > 0.8)
+   * and final transcripts.
+   * 
+ * + * + * .google.cloud.speech.v1.TranscriptNormalization transcript_normalization = 24 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the transcriptNormalization field is set. + */ + @java.lang.Override + public boolean hasTranscriptNormalization() { + return transcriptNormalization_ != null; + } + /** + * + * + *
+   * Optional. Use transcription normalization to automatically replace parts of
+   * the transcript with phrases of your choosing. For StreamingRecognize, this
+   * normalization only applies to stable partial transcripts (stability > 0.8)
+   * and final transcripts.
+   * 
+ * + * + * .google.cloud.speech.v1.TranscriptNormalization transcript_normalization = 24 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The transcriptNormalization. + */ + @java.lang.Override + public com.google.cloud.speech.v1.TranscriptNormalization getTranscriptNormalization() { + return transcriptNormalization_ == null + ? com.google.cloud.speech.v1.TranscriptNormalization.getDefaultInstance() + : transcriptNormalization_; + } + /** + * + * + *
+   * Optional. Use transcription normalization to automatically replace parts of
+   * the transcript with phrases of your choosing. For StreamingRecognize, this
+   * normalization only applies to stable partial transcripts (stability > 0.8)
+   * and final transcripts.
+   * 
+ * + * + * .google.cloud.speech.v1.TranscriptNormalization transcript_normalization = 24 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.speech.v1.TranscriptNormalizationOrBuilder + getTranscriptNormalizationOrBuilder() { + return transcriptNormalization_ == null + ? com.google.cloud.speech.v1.TranscriptNormalization.getDefaultInstance() + : transcriptNormalization_; + } + public static final int SPEECH_CONTEXTS_FIELD_NUMBER = 6; @SuppressWarnings("serial") @@ -1467,6 +1561,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (enableSpokenEmojis_ != null) { output.writeMessage(23, getEnableSpokenEmojis()); } + if (transcriptNormalization_ != null) { + output.writeMessage(24, getTranscriptNormalization()); + } getUnknownFields().writeTo(output); } @@ -1545,6 +1642,11 @@ public int getSerializedSize() { if (enableSpokenEmojis_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(23, getEnableSpokenEmojis()); } + if (transcriptNormalization_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 24, getTranscriptNormalization()); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -1575,6 +1677,10 @@ public boolean equals(final java.lang.Object obj) { if (hasAdaptation()) { if (!getAdaptation().equals(other.getAdaptation())) return false; } + if (hasTranscriptNormalization() != other.hasTranscriptNormalization()) return false; + if (hasTranscriptNormalization()) { + if (!getTranscriptNormalization().equals(other.getTranscriptNormalization())) return false; + } if (!getSpeechContextsList().equals(other.getSpeechContextsList())) return false; if (getEnableWordTimeOffsets() != other.getEnableWordTimeOffsets()) return false; if (getEnableWordConfidence() != other.getEnableWordConfidence()) return false; @@ -1632,6 +1738,10 @@ public int hashCode() { hash = (37 * hash) + ADAPTATION_FIELD_NUMBER; hash = (53 * hash) + getAdaptation().hashCode(); } + if (hasTranscriptNormalization()) { + hash = (37 * hash) + TRANSCRIPT_NORMALIZATION_FIELD_NUMBER; + hash = (53 * hash) + getTranscriptNormalization().hashCode(); + } if (getSpeechContextsCount() > 0) { hash = (37 * hash) + SPEECH_CONTEXTS_FIELD_NUMBER; hash = (53 * hash) + getSpeechContextsList().hashCode(); @@ -1815,13 +1925,18 @@ public Builder clear() { adaptationBuilder_.dispose(); adaptationBuilder_ = null; } + transcriptNormalization_ = null; + if (transcriptNormalizationBuilder_ != null) { + transcriptNormalizationBuilder_.dispose(); + transcriptNormalizationBuilder_ = null; + } if (speechContextsBuilder_ == null) { speechContexts_ = java.util.Collections.emptyList(); } else { speechContexts_ = null; speechContextsBuilder_.clear(); } - bitField0_ = (bitField0_ & ~0x00000200); + bitField0_ = (bitField0_ & ~0x00000400); enableWordTimeOffsets_ = false; enableWordConfidence_ = false; enableAutomaticPunctuation_ = false; @@ -1884,9 +1999,9 @@ public com.google.cloud.speech.v1.RecognitionConfig buildPartial() { private void buildPartialRepeatedFields(com.google.cloud.speech.v1.RecognitionConfig result) { if (speechContextsBuilder_ == null) { - if (((bitField0_ & 0x00000200) != 0)) { + if (((bitField0_ & 0x00000400) != 0)) { speechContexts_ = java.util.Collections.unmodifiableList(speechContexts_); - bitField0_ = (bitField0_ & ~0x00000200); + bitField0_ = (bitField0_ & ~0x00000400); } result.speechContexts_ = speechContexts_; } else { @@ -1924,40 +2039,46 @@ private void buildPartial0(com.google.cloud.speech.v1.RecognitionConfig result) if (((from_bitField0_ & 0x00000100) != 0)) { result.adaptation_ = adaptationBuilder_ == null ? adaptation_ : adaptationBuilder_.build(); } - if (((from_bitField0_ & 0x00000400) != 0)) { - result.enableWordTimeOffsets_ = enableWordTimeOffsets_; + if (((from_bitField0_ & 0x00000200) != 0)) { + result.transcriptNormalization_ = + transcriptNormalizationBuilder_ == null + ? transcriptNormalization_ + : transcriptNormalizationBuilder_.build(); } if (((from_bitField0_ & 0x00000800) != 0)) { - result.enableWordConfidence_ = enableWordConfidence_; + result.enableWordTimeOffsets_ = enableWordTimeOffsets_; } if (((from_bitField0_ & 0x00001000) != 0)) { - result.enableAutomaticPunctuation_ = enableAutomaticPunctuation_; + result.enableWordConfidence_ = enableWordConfidence_; } if (((from_bitField0_ & 0x00002000) != 0)) { + result.enableAutomaticPunctuation_ = enableAutomaticPunctuation_; + } + if (((from_bitField0_ & 0x00004000) != 0)) { result.enableSpokenPunctuation_ = enableSpokenPunctuationBuilder_ == null ? enableSpokenPunctuation_ : enableSpokenPunctuationBuilder_.build(); } - if (((from_bitField0_ & 0x00004000) != 0)) { + if (((from_bitField0_ & 0x00008000) != 0)) { result.enableSpokenEmojis_ = enableSpokenEmojisBuilder_ == null ? enableSpokenEmojis_ : enableSpokenEmojisBuilder_.build(); } - if (((from_bitField0_ & 0x00008000) != 0)) { + if (((from_bitField0_ & 0x00010000) != 0)) { result.diarizationConfig_ = diarizationConfigBuilder_ == null ? diarizationConfig_ : diarizationConfigBuilder_.build(); } - if (((from_bitField0_ & 0x00010000) != 0)) { + if (((from_bitField0_ & 0x00020000) != 0)) { result.metadata_ = metadataBuilder_ == null ? metadata_ : metadataBuilder_.build(); } - if (((from_bitField0_ & 0x00020000) != 0)) { + if (((from_bitField0_ & 0x00040000) != 0)) { result.model_ = model_; } - if (((from_bitField0_ & 0x00040000) != 0)) { + if (((from_bitField0_ & 0x00080000) != 0)) { result.useEnhanced_ = useEnhanced_; } } @@ -2043,11 +2164,14 @@ public Builder mergeFrom(com.google.cloud.speech.v1.RecognitionConfig other) { if (other.hasAdaptation()) { mergeAdaptation(other.getAdaptation()); } + if (other.hasTranscriptNormalization()) { + mergeTranscriptNormalization(other.getTranscriptNormalization()); + } if (speechContextsBuilder_ == null) { if (!other.speechContexts_.isEmpty()) { if (speechContexts_.isEmpty()) { speechContexts_ = other.speechContexts_; - bitField0_ = (bitField0_ & ~0x00000200); + bitField0_ = (bitField0_ & ~0x00000400); } else { ensureSpeechContextsIsMutable(); speechContexts_.addAll(other.speechContexts_); @@ -2060,7 +2184,7 @@ public Builder mergeFrom(com.google.cloud.speech.v1.RecognitionConfig other) { speechContextsBuilder_.dispose(); speechContextsBuilder_ = null; speechContexts_ = other.speechContexts_; - bitField0_ = (bitField0_ & ~0x00000200); + bitField0_ = (bitField0_ & ~0x00000400); speechContextsBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getSpeechContextsFieldBuilder() @@ -2093,7 +2217,7 @@ public Builder mergeFrom(com.google.cloud.speech.v1.RecognitionConfig other) { } if (!other.getModel().isEmpty()) { model_ = other.model_; - bitField0_ |= 0x00020000; + bitField0_ |= 0x00040000; onChanged(); } if (other.getUseEnhanced() != false) { @@ -2177,19 +2301,19 @@ public Builder mergeFrom( case 64: { enableWordTimeOffsets_ = input.readBool(); - bitField0_ |= 0x00000400; + bitField0_ |= 0x00000800; break; } // case 64 case 74: { input.readMessage(getMetadataFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00010000; + bitField0_ |= 0x00020000; break; } // case 74 case 88: { enableAutomaticPunctuation_ = input.readBool(); - bitField0_ |= 0x00001000; + bitField0_ |= 0x00002000; break; } // case 88 case 96: @@ -2201,19 +2325,19 @@ public Builder mergeFrom( case 106: { model_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00020000; + bitField0_ |= 0x00040000; break; } // case 106 case 112: { useEnhanced_ = input.readBool(); - bitField0_ |= 0x00040000; + bitField0_ |= 0x00080000; break; } // case 112 case 120: { enableWordConfidence_ = input.readBool(); - bitField0_ |= 0x00000800; + bitField0_ |= 0x00001000; break; } // case 120 case 146: @@ -2227,7 +2351,7 @@ public Builder mergeFrom( { input.readMessage( getDiarizationConfigFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00008000; + bitField0_ |= 0x00010000; break; } // case 154 case 162: @@ -2240,16 +2364,23 @@ public Builder mergeFrom( { input.readMessage( getEnableSpokenPunctuationFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00002000; + bitField0_ |= 0x00004000; break; } // case 178 case 186: { input.readMessage( getEnableSpokenEmojisFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00004000; + bitField0_ |= 0x00008000; break; } // case 186 + case 194: + { + input.readMessage( + getTranscriptNormalizationFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000200; + break; + } // case 194 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -3347,14 +3478,248 @@ public com.google.cloud.speech.v1.SpeechAdaptationOrBuilder getAdaptationOrBuild return adaptationBuilder_; } + private com.google.cloud.speech.v1.TranscriptNormalization transcriptNormalization_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1.TranscriptNormalization, + com.google.cloud.speech.v1.TranscriptNormalization.Builder, + com.google.cloud.speech.v1.TranscriptNormalizationOrBuilder> + transcriptNormalizationBuilder_; + /** + * + * + *
+     * Optional. Use transcription normalization to automatically replace parts of
+     * the transcript with phrases of your choosing. For StreamingRecognize, this
+     * normalization only applies to stable partial transcripts (stability > 0.8)
+     * and final transcripts.
+     * 
+ * + * + * .google.cloud.speech.v1.TranscriptNormalization transcript_normalization = 24 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the transcriptNormalization field is set. + */ + public boolean hasTranscriptNormalization() { + return ((bitField0_ & 0x00000200) != 0); + } + /** + * + * + *
+     * Optional. Use transcription normalization to automatically replace parts of
+     * the transcript with phrases of your choosing. For StreamingRecognize, this
+     * normalization only applies to stable partial transcripts (stability > 0.8)
+     * and final transcripts.
+     * 
+ * + * + * .google.cloud.speech.v1.TranscriptNormalization transcript_normalization = 24 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The transcriptNormalization. + */ + public com.google.cloud.speech.v1.TranscriptNormalization getTranscriptNormalization() { + if (transcriptNormalizationBuilder_ == null) { + return transcriptNormalization_ == null + ? com.google.cloud.speech.v1.TranscriptNormalization.getDefaultInstance() + : transcriptNormalization_; + } else { + return transcriptNormalizationBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. Use transcription normalization to automatically replace parts of
+     * the transcript with phrases of your choosing. For StreamingRecognize, this
+     * normalization only applies to stable partial transcripts (stability > 0.8)
+     * and final transcripts.
+     * 
+ * + * + * .google.cloud.speech.v1.TranscriptNormalization transcript_normalization = 24 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setTranscriptNormalization( + com.google.cloud.speech.v1.TranscriptNormalization value) { + if (transcriptNormalizationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + transcriptNormalization_ = value; + } else { + transcriptNormalizationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Use transcription normalization to automatically replace parts of
+     * the transcript with phrases of your choosing. For StreamingRecognize, this
+     * normalization only applies to stable partial transcripts (stability > 0.8)
+     * and final transcripts.
+     * 
+ * + * + * .google.cloud.speech.v1.TranscriptNormalization transcript_normalization = 24 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setTranscriptNormalization( + com.google.cloud.speech.v1.TranscriptNormalization.Builder builderForValue) { + if (transcriptNormalizationBuilder_ == null) { + transcriptNormalization_ = builderForValue.build(); + } else { + transcriptNormalizationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Use transcription normalization to automatically replace parts of
+     * the transcript with phrases of your choosing. For StreamingRecognize, this
+     * normalization only applies to stable partial transcripts (stability > 0.8)
+     * and final transcripts.
+     * 
+ * + * + * .google.cloud.speech.v1.TranscriptNormalization transcript_normalization = 24 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeTranscriptNormalization( + com.google.cloud.speech.v1.TranscriptNormalization value) { + if (transcriptNormalizationBuilder_ == null) { + if (((bitField0_ & 0x00000200) != 0) + && transcriptNormalization_ != null + && transcriptNormalization_ + != com.google.cloud.speech.v1.TranscriptNormalization.getDefaultInstance()) { + getTranscriptNormalizationBuilder().mergeFrom(value); + } else { + transcriptNormalization_ = value; + } + } else { + transcriptNormalizationBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Use transcription normalization to automatically replace parts of
+     * the transcript with phrases of your choosing. For StreamingRecognize, this
+     * normalization only applies to stable partial transcripts (stability > 0.8)
+     * and final transcripts.
+     * 
+ * + * + * .google.cloud.speech.v1.TranscriptNormalization transcript_normalization = 24 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearTranscriptNormalization() { + bitField0_ = (bitField0_ & ~0x00000200); + transcriptNormalization_ = null; + if (transcriptNormalizationBuilder_ != null) { + transcriptNormalizationBuilder_.dispose(); + transcriptNormalizationBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Use transcription normalization to automatically replace parts of
+     * the transcript with phrases of your choosing. For StreamingRecognize, this
+     * normalization only applies to stable partial transcripts (stability > 0.8)
+     * and final transcripts.
+     * 
+ * + * + * .google.cloud.speech.v1.TranscriptNormalization transcript_normalization = 24 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.speech.v1.TranscriptNormalization.Builder + getTranscriptNormalizationBuilder() { + bitField0_ |= 0x00000200; + onChanged(); + return getTranscriptNormalizationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. Use transcription normalization to automatically replace parts of
+     * the transcript with phrases of your choosing. For StreamingRecognize, this
+     * normalization only applies to stable partial transcripts (stability > 0.8)
+     * and final transcripts.
+     * 
+ * + * + * .google.cloud.speech.v1.TranscriptNormalization transcript_normalization = 24 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.speech.v1.TranscriptNormalizationOrBuilder + getTranscriptNormalizationOrBuilder() { + if (transcriptNormalizationBuilder_ != null) { + return transcriptNormalizationBuilder_.getMessageOrBuilder(); + } else { + return transcriptNormalization_ == null + ? com.google.cloud.speech.v1.TranscriptNormalization.getDefaultInstance() + : transcriptNormalization_; + } + } + /** + * + * + *
+     * Optional. Use transcription normalization to automatically replace parts of
+     * the transcript with phrases of your choosing. For StreamingRecognize, this
+     * normalization only applies to stable partial transcripts (stability > 0.8)
+     * and final transcripts.
+     * 
+ * + * + * .google.cloud.speech.v1.TranscriptNormalization transcript_normalization = 24 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1.TranscriptNormalization, + com.google.cloud.speech.v1.TranscriptNormalization.Builder, + com.google.cloud.speech.v1.TranscriptNormalizationOrBuilder> + getTranscriptNormalizationFieldBuilder() { + if (transcriptNormalizationBuilder_ == null) { + transcriptNormalizationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1.TranscriptNormalization, + com.google.cloud.speech.v1.TranscriptNormalization.Builder, + com.google.cloud.speech.v1.TranscriptNormalizationOrBuilder>( + getTranscriptNormalization(), getParentForChildren(), isClean()); + transcriptNormalization_ = null; + } + return transcriptNormalizationBuilder_; + } + private java.util.List speechContexts_ = java.util.Collections.emptyList(); private void ensureSpeechContextsIsMutable() { - if (!((bitField0_ & 0x00000200) != 0)) { + if (!((bitField0_ & 0x00000400) != 0)) { speechContexts_ = new java.util.ArrayList(speechContexts_); - bitField0_ |= 0x00000200; + bitField0_ |= 0x00000400; } } @@ -3614,7 +3979,7 @@ public Builder addAllSpeechContexts( public Builder clearSpeechContexts() { if (speechContextsBuilder_ == null) { speechContexts_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000200); + bitField0_ = (bitField0_ & ~0x00000400); onChanged(); } else { speechContextsBuilder_.clear(); @@ -3765,7 +4130,7 @@ public com.google.cloud.speech.v1.SpeechContext.Builder addSpeechContextsBuilder com.google.cloud.speech.v1.SpeechContext.Builder, com.google.cloud.speech.v1.SpeechContextOrBuilder>( speechContexts_, - ((bitField0_ & 0x00000200) != 0), + ((bitField0_ & 0x00000400) != 0), getParentForChildren(), isClean()); speechContexts_ = null; @@ -3810,7 +4175,7 @@ public boolean getEnableWordTimeOffsets() { public Builder setEnableWordTimeOffsets(boolean value) { enableWordTimeOffsets_ = value; - bitField0_ |= 0x00000400; + bitField0_ |= 0x00000800; onChanged(); return this; } @@ -3829,7 +4194,7 @@ public Builder setEnableWordTimeOffsets(boolean value) { * @return This builder for chaining. */ public Builder clearEnableWordTimeOffsets() { - bitField0_ = (bitField0_ & ~0x00000400); + bitField0_ = (bitField0_ & ~0x00000800); enableWordTimeOffsets_ = false; onChanged(); return this; @@ -3870,7 +4235,7 @@ public boolean getEnableWordConfidence() { public Builder setEnableWordConfidence(boolean value) { enableWordConfidence_ = value; - bitField0_ |= 0x00000800; + bitField0_ |= 0x00001000; onChanged(); return this; } @@ -3888,7 +4253,7 @@ public Builder setEnableWordConfidence(boolean value) { * @return This builder for chaining. */ public Builder clearEnableWordConfidence() { - bitField0_ = (bitField0_ & ~0x00000800); + bitField0_ = (bitField0_ & ~0x00001000); enableWordConfidence_ = false; onChanged(); return this; @@ -3931,7 +4296,7 @@ public boolean getEnableAutomaticPunctuation() { public Builder setEnableAutomaticPunctuation(boolean value) { enableAutomaticPunctuation_ = value; - bitField0_ |= 0x00001000; + bitField0_ |= 0x00002000; onChanged(); return this; } @@ -3950,7 +4315,7 @@ public Builder setEnableAutomaticPunctuation(boolean value) { * @return This builder for chaining. */ public Builder clearEnableAutomaticPunctuation() { - bitField0_ = (bitField0_ & ~0x00001000); + bitField0_ = (bitField0_ & ~0x00002000); enableAutomaticPunctuation_ = false; onChanged(); return this; @@ -3980,7 +4345,7 @@ public Builder clearEnableAutomaticPunctuation() { * @return Whether the enableSpokenPunctuation field is set. */ public boolean hasEnableSpokenPunctuation() { - return ((bitField0_ & 0x00002000) != 0); + return ((bitField0_ & 0x00004000) != 0); } /** * @@ -4032,7 +4397,7 @@ public Builder setEnableSpokenPunctuation(com.google.protobuf.BoolValue value) { } else { enableSpokenPunctuationBuilder_.setMessage(value); } - bitField0_ |= 0x00002000; + bitField0_ |= 0x00004000; onChanged(); return this; } @@ -4058,7 +4423,7 @@ public Builder setEnableSpokenPunctuation( } else { enableSpokenPunctuationBuilder_.setMessage(builderForValue.build()); } - bitField0_ |= 0x00002000; + bitField0_ |= 0x00004000; onChanged(); return this; } @@ -4079,7 +4444,7 @@ public Builder setEnableSpokenPunctuation( */ public Builder mergeEnableSpokenPunctuation(com.google.protobuf.BoolValue value) { if (enableSpokenPunctuationBuilder_ == null) { - if (((bitField0_ & 0x00002000) != 0) + if (((bitField0_ & 0x00004000) != 0) && enableSpokenPunctuation_ != null && enableSpokenPunctuation_ != com.google.protobuf.BoolValue.getDefaultInstance()) { getEnableSpokenPunctuationBuilder().mergeFrom(value); @@ -4089,7 +4454,7 @@ public Builder mergeEnableSpokenPunctuation(com.google.protobuf.BoolValue value) } else { enableSpokenPunctuationBuilder_.mergeFrom(value); } - bitField0_ |= 0x00002000; + bitField0_ |= 0x00004000; onChanged(); return this; } @@ -4109,7 +4474,7 @@ public Builder mergeEnableSpokenPunctuation(com.google.protobuf.BoolValue value) * .google.protobuf.BoolValue enable_spoken_punctuation = 22; */ public Builder clearEnableSpokenPunctuation() { - bitField0_ = (bitField0_ & ~0x00002000); + bitField0_ = (bitField0_ & ~0x00004000); enableSpokenPunctuation_ = null; if (enableSpokenPunctuationBuilder_ != null) { enableSpokenPunctuationBuilder_.dispose(); @@ -4134,7 +4499,7 @@ public Builder clearEnableSpokenPunctuation() { * .google.protobuf.BoolValue enable_spoken_punctuation = 22; */ public com.google.protobuf.BoolValue.Builder getEnableSpokenPunctuationBuilder() { - bitField0_ |= 0x00002000; + bitField0_ |= 0x00004000; onChanged(); return getEnableSpokenPunctuationFieldBuilder().getBuilder(); } @@ -4216,7 +4581,7 @@ public com.google.protobuf.BoolValueOrBuilder getEnableSpokenPunctuationOrBuilde * @return Whether the enableSpokenEmojis field is set. */ public boolean hasEnableSpokenEmojis() { - return ((bitField0_ & 0x00004000) != 0); + return ((bitField0_ & 0x00008000) != 0); } /** * @@ -4264,7 +4629,7 @@ public Builder setEnableSpokenEmojis(com.google.protobuf.BoolValue value) { } else { enableSpokenEmojisBuilder_.setMessage(value); } - bitField0_ |= 0x00004000; + bitField0_ |= 0x00008000; onChanged(); return this; } @@ -4287,7 +4652,7 @@ public Builder setEnableSpokenEmojis(com.google.protobuf.BoolValue.Builder build } else { enableSpokenEmojisBuilder_.setMessage(builderForValue.build()); } - bitField0_ |= 0x00004000; + bitField0_ |= 0x00008000; onChanged(); return this; } @@ -4306,7 +4671,7 @@ public Builder setEnableSpokenEmojis(com.google.protobuf.BoolValue.Builder build */ public Builder mergeEnableSpokenEmojis(com.google.protobuf.BoolValue value) { if (enableSpokenEmojisBuilder_ == null) { - if (((bitField0_ & 0x00004000) != 0) + if (((bitField0_ & 0x00008000) != 0) && enableSpokenEmojis_ != null && enableSpokenEmojis_ != com.google.protobuf.BoolValue.getDefaultInstance()) { getEnableSpokenEmojisBuilder().mergeFrom(value); @@ -4316,7 +4681,7 @@ public Builder mergeEnableSpokenEmojis(com.google.protobuf.BoolValue value) { } else { enableSpokenEmojisBuilder_.mergeFrom(value); } - bitField0_ |= 0x00004000; + bitField0_ |= 0x00008000; onChanged(); return this; } @@ -4334,7 +4699,7 @@ public Builder mergeEnableSpokenEmojis(com.google.protobuf.BoolValue value) { * .google.protobuf.BoolValue enable_spoken_emojis = 23; */ public Builder clearEnableSpokenEmojis() { - bitField0_ = (bitField0_ & ~0x00004000); + bitField0_ = (bitField0_ & ~0x00008000); enableSpokenEmojis_ = null; if (enableSpokenEmojisBuilder_ != null) { enableSpokenEmojisBuilder_.dispose(); @@ -4357,7 +4722,7 @@ public Builder clearEnableSpokenEmojis() { * .google.protobuf.BoolValue enable_spoken_emojis = 23; */ public com.google.protobuf.BoolValue.Builder getEnableSpokenEmojisBuilder() { - bitField0_ |= 0x00004000; + bitField0_ |= 0x00008000; onChanged(); return getEnableSpokenEmojisFieldBuilder().getBuilder(); } @@ -4438,7 +4803,7 @@ public com.google.protobuf.BoolValueOrBuilder getEnableSpokenEmojisOrBuilder() { * @return Whether the diarizationConfig field is set. */ public boolean hasDiarizationConfig() { - return ((bitField0_ & 0x00008000) != 0); + return ((bitField0_ & 0x00010000) != 0); } /** * @@ -4492,7 +4857,7 @@ public Builder setDiarizationConfig(com.google.cloud.speech.v1.SpeakerDiarizatio } else { diarizationConfigBuilder_.setMessage(value); } - bitField0_ |= 0x00008000; + bitField0_ |= 0x00010000; onChanged(); return this; } @@ -4519,7 +4884,7 @@ public Builder setDiarizationConfig( } else { diarizationConfigBuilder_.setMessage(builderForValue.build()); } - bitField0_ |= 0x00008000; + bitField0_ |= 0x00010000; onChanged(); return this; } @@ -4542,7 +4907,7 @@ public Builder setDiarizationConfig( public Builder mergeDiarizationConfig( com.google.cloud.speech.v1.SpeakerDiarizationConfig value) { if (diarizationConfigBuilder_ == null) { - if (((bitField0_ & 0x00008000) != 0) + if (((bitField0_ & 0x00010000) != 0) && diarizationConfig_ != null && diarizationConfig_ != com.google.cloud.speech.v1.SpeakerDiarizationConfig.getDefaultInstance()) { @@ -4553,7 +4918,7 @@ public Builder mergeDiarizationConfig( } else { diarizationConfigBuilder_.mergeFrom(value); } - bitField0_ |= 0x00008000; + bitField0_ |= 0x00010000; onChanged(); return this; } @@ -4574,7 +4939,7 @@ public Builder mergeDiarizationConfig( * .google.cloud.speech.v1.SpeakerDiarizationConfig diarization_config = 19; */ public Builder clearDiarizationConfig() { - bitField0_ = (bitField0_ & ~0x00008000); + bitField0_ = (bitField0_ & ~0x00010000); diarizationConfig_ = null; if (diarizationConfigBuilder_ != null) { diarizationConfigBuilder_.dispose(); @@ -4601,7 +4966,7 @@ public Builder clearDiarizationConfig() { */ public com.google.cloud.speech.v1.SpeakerDiarizationConfig.Builder getDiarizationConfigBuilder() { - bitField0_ |= 0x00008000; + bitField0_ |= 0x00010000; onChanged(); return getDiarizationConfigFieldBuilder().getBuilder(); } @@ -4682,7 +5047,7 @@ public Builder clearDiarizationConfig() { * @return Whether the metadata field is set. */ public boolean hasMetadata() { - return ((bitField0_ & 0x00010000) != 0); + return ((bitField0_ & 0x00020000) != 0); } /** * @@ -4722,7 +5087,7 @@ public Builder setMetadata(com.google.cloud.speech.v1.RecognitionMetadata value) } else { metadataBuilder_.setMessage(value); } - bitField0_ |= 0x00010000; + bitField0_ |= 0x00020000; onChanged(); return this; } @@ -4742,7 +5107,7 @@ public Builder setMetadata( } else { metadataBuilder_.setMessage(builderForValue.build()); } - bitField0_ |= 0x00010000; + bitField0_ |= 0x00020000; onChanged(); return this; } @@ -4757,7 +5122,7 @@ public Builder setMetadata( */ public Builder mergeMetadata(com.google.cloud.speech.v1.RecognitionMetadata value) { if (metadataBuilder_ == null) { - if (((bitField0_ & 0x00010000) != 0) + if (((bitField0_ & 0x00020000) != 0) && metadata_ != null && metadata_ != com.google.cloud.speech.v1.RecognitionMetadata.getDefaultInstance()) { getMetadataBuilder().mergeFrom(value); @@ -4767,7 +5132,7 @@ public Builder mergeMetadata(com.google.cloud.speech.v1.RecognitionMetadata valu } else { metadataBuilder_.mergeFrom(value); } - bitField0_ |= 0x00010000; + bitField0_ |= 0x00020000; onChanged(); return this; } @@ -4781,7 +5146,7 @@ public Builder mergeMetadata(com.google.cloud.speech.v1.RecognitionMetadata valu * .google.cloud.speech.v1.RecognitionMetadata metadata = 9; */ public Builder clearMetadata() { - bitField0_ = (bitField0_ & ~0x00010000); + bitField0_ = (bitField0_ & ~0x00020000); metadata_ = null; if (metadataBuilder_ != null) { metadataBuilder_.dispose(); @@ -4800,7 +5165,7 @@ public Builder clearMetadata() { * .google.cloud.speech.v1.RecognitionMetadata metadata = 9; */ public com.google.cloud.speech.v1.RecognitionMetadata.Builder getMetadataBuilder() { - bitField0_ |= 0x00010000; + bitField0_ |= 0x00020000; onChanged(); return getMetadataFieldBuilder().getBuilder(); } @@ -5060,7 +5425,7 @@ public Builder setModel(java.lang.String value) { throw new NullPointerException(); } model_ = value; - bitField0_ |= 0x00020000; + bitField0_ |= 0x00040000; onChanged(); return this; } @@ -5127,7 +5492,7 @@ public Builder setModel(java.lang.String value) { */ public Builder clearModel() { model_ = getDefaultInstance().getModel(); - bitField0_ = (bitField0_ & ~0x00020000); + bitField0_ = (bitField0_ & ~0x00040000); onChanged(); return this; } @@ -5199,7 +5564,7 @@ public Builder setModelBytes(com.google.protobuf.ByteString value) { } checkByteStringIsUtf8(value); model_ = value; - bitField0_ |= 0x00020000; + bitField0_ |= 0x00040000; onChanged(); return this; } @@ -5249,7 +5614,7 @@ public boolean getUseEnhanced() { public Builder setUseEnhanced(boolean value) { useEnhanced_ = value; - bitField0_ |= 0x00040000; + bitField0_ |= 0x00080000; onChanged(); return this; } @@ -5272,7 +5637,7 @@ public Builder setUseEnhanced(boolean value) { * @return This builder for chaining. */ public Builder clearUseEnhanced() { - bitField0_ = (bitField0_ & ~0x00040000); + bitField0_ = (bitField0_ & ~0x00080000); useEnhanced_ = false; onChanged(); return this; diff --git a/java-speech/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognitionConfigOrBuilder.java b/java-speech/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognitionConfigOrBuilder.java index 83b42b65d3e1..4af6e163b7cd 100644 --- a/java-speech/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognitionConfigOrBuilder.java +++ b/java-speech/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognitionConfigOrBuilder.java @@ -323,6 +323,56 @@ public interface RecognitionConfigOrBuilder */ com.google.cloud.speech.v1.SpeechAdaptationOrBuilder getAdaptationOrBuilder(); + /** + * + * + *
+   * Optional. Use transcription normalization to automatically replace parts of
+   * the transcript with phrases of your choosing. For StreamingRecognize, this
+   * normalization only applies to stable partial transcripts (stability > 0.8)
+   * and final transcripts.
+   * 
+ * + * + * .google.cloud.speech.v1.TranscriptNormalization transcript_normalization = 24 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the transcriptNormalization field is set. + */ + boolean hasTranscriptNormalization(); + /** + * + * + *
+   * Optional. Use transcription normalization to automatically replace parts of
+   * the transcript with phrases of your choosing. For StreamingRecognize, this
+   * normalization only applies to stable partial transcripts (stability > 0.8)
+   * and final transcripts.
+   * 
+ * + * + * .google.cloud.speech.v1.TranscriptNormalization transcript_normalization = 24 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The transcriptNormalization. + */ + com.google.cloud.speech.v1.TranscriptNormalization getTranscriptNormalization(); + /** + * + * + *
+   * Optional. Use transcription normalization to automatically replace parts of
+   * the transcript with phrases of your choosing. For StreamingRecognize, this
+   * normalization only applies to stable partial transcripts (stability > 0.8)
+   * and final transcripts.
+   * 
+ * + * + * .google.cloud.speech.v1.TranscriptNormalization transcript_normalization = 24 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.speech.v1.TranscriptNormalizationOrBuilder getTranscriptNormalizationOrBuilder(); + /** * * diff --git a/java-speech/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeakerDiarizationConfig.java b/java-speech/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeakerDiarizationConfig.java index 4bbe107b04a4..aa7cc47035c3 100644 --- a/java-speech/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeakerDiarizationConfig.java +++ b/java-speech/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeakerDiarizationConfig.java @@ -67,8 +67,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * *
    * If 'true', enables speaker detection for each recognized word in
-   * the top alternative of the recognition result using a speaker_tag provided
-   * in the WordInfo.
+   * the top alternative of the recognition result using a speaker_label
+   * provided in the WordInfo.
    * 
* * bool enable_speaker_diarization = 1; @@ -133,7 +133,7 @@ public int getMaxSpeakerCount() { * * * @deprecated google.cloud.speech.v1.SpeakerDiarizationConfig.speaker_tag is deprecated. See - * google/cloud/speech/v1/cloud_speech.proto;l=480 + * google/cloud/speech/v1/cloud_speech.proto;l=493 * @return The speakerTag. */ @java.lang.Override @@ -554,8 +554,8 @@ public Builder mergeFrom( * *
      * If 'true', enables speaker detection for each recognized word in
-     * the top alternative of the recognition result using a speaker_tag provided
-     * in the WordInfo.
+     * the top alternative of the recognition result using a speaker_label
+     * provided in the WordInfo.
      * 
* * bool enable_speaker_diarization = 1; @@ -571,8 +571,8 @@ public boolean getEnableSpeakerDiarization() { * *
      * If 'true', enables speaker detection for each recognized word in
-     * the top alternative of the recognition result using a speaker_tag provided
-     * in the WordInfo.
+     * the top alternative of the recognition result using a speaker_label
+     * provided in the WordInfo.
      * 
* * bool enable_speaker_diarization = 1; @@ -592,8 +592,8 @@ public Builder setEnableSpeakerDiarization(boolean value) { * *
      * If 'true', enables speaker detection for each recognized word in
-     * the top alternative of the recognition result using a speaker_tag provided
-     * in the WordInfo.
+     * the top alternative of the recognition result using a speaker_label
+     * provided in the WordInfo.
      * 
* * bool enable_speaker_diarization = 1; @@ -737,7 +737,7 @@ public Builder clearMaxSpeakerCount() { * * * @deprecated google.cloud.speech.v1.SpeakerDiarizationConfig.speaker_tag is deprecated. See - * google/cloud/speech/v1/cloud_speech.proto;l=480 + * google/cloud/speech/v1/cloud_speech.proto;l=493 * @return The speakerTag. */ @java.lang.Override @@ -756,7 +756,7 @@ public int getSpeakerTag() { * * * @deprecated google.cloud.speech.v1.SpeakerDiarizationConfig.speaker_tag is deprecated. See - * google/cloud/speech/v1/cloud_speech.proto;l=480 + * google/cloud/speech/v1/cloud_speech.proto;l=493 * @param value The speakerTag to set. * @return This builder for chaining. */ @@ -779,7 +779,7 @@ public Builder setSpeakerTag(int value) { * * * @deprecated google.cloud.speech.v1.SpeakerDiarizationConfig.speaker_tag is deprecated. See - * google/cloud/speech/v1/cloud_speech.proto;l=480 + * google/cloud/speech/v1/cloud_speech.proto;l=493 * @return This builder for chaining. */ @java.lang.Deprecated diff --git a/java-speech/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeakerDiarizationConfigOrBuilder.java b/java-speech/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeakerDiarizationConfigOrBuilder.java index b312f418a3ec..c5b2dc47d61e 100644 --- a/java-speech/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeakerDiarizationConfigOrBuilder.java +++ b/java-speech/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeakerDiarizationConfigOrBuilder.java @@ -28,8 +28,8 @@ public interface SpeakerDiarizationConfigOrBuilder * *
    * If 'true', enables speaker detection for each recognized word in
-   * the top alternative of the recognition result using a speaker_tag provided
-   * in the WordInfo.
+   * the top alternative of the recognition result using a speaker_label
+   * provided in the WordInfo.
    * 
* * bool enable_speaker_diarization = 1; @@ -79,7 +79,7 @@ public interface SpeakerDiarizationConfigOrBuilder * * * @deprecated google.cloud.speech.v1.SpeakerDiarizationConfig.speaker_tag is deprecated. See - * google/cloud/speech/v1/cloud_speech.proto;l=480 + * google/cloud/speech/v1/cloud_speech.proto;l=493 * @return The speakerTag. */ @java.lang.Deprecated diff --git a/java-speech/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechProto.java b/java-speech/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechProto.java index 92fdcd311221..7bb0b7129cce 100644 --- a/java-speech/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechProto.java +++ b/java-speech/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechProto.java @@ -150,7 +150,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "meout\032\206\001\n\024VoiceActivityTimeout\0227\n\024speech" + "_start_timeout\030\001 \001(\0132\031.google.protobuf.D" + "uration\0225\n\022speech_end_timeout\030\002 \001(\0132\031.go" - + "ogle.protobuf.Duration\"\352\007\n\021RecognitionCo" + + "ogle.protobuf.Duration\"\314\010\n\021RecognitionCo" + "nfig\022I\n\010encoding\030\001 \001(\01627.google.cloud.sp" + "eech.v1.RecognitionConfig.AudioEncoding\022" + "\031\n\021sample_rate_hertz\030\002 \001(\005\022\033\n\023audio_chan" @@ -160,128 +160,131 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "des\030\022 \003(\t\022\030\n\020max_alternatives\030\004 \001(\005\022\030\n\020p" + "rofanity_filter\030\005 \001(\010\022<\n\nadaptation\030\024 \001(" + "\0132(.google.cloud.speech.v1.SpeechAdaptat" - + "ion\022>\n\017speech_contexts\030\006 \003(\0132%.google.cl" - + "oud.speech.v1.SpeechContext\022 \n\030enable_wo" - + "rd_time_offsets\030\010 \001(\010\022\036\n\026enable_word_con" - + "fidence\030\017 \001(\010\022$\n\034enable_automatic_punctu" - + "ation\030\013 \001(\010\022=\n\031enable_spoken_punctuation" - + "\030\026 \001(\0132\032.google.protobuf.BoolValue\0228\n\024en" - + "able_spoken_emojis\030\027 \001(\0132\032.google.protob" - + "uf.BoolValue\022L\n\022diarization_config\030\023 \001(\013" - + "20.google.cloud.speech.v1.SpeakerDiariza" - + "tionConfig\022=\n\010metadata\030\t \001(\0132+.google.cl" - + "oud.speech.v1.RecognitionMetadata\022\r\n\005mod" - + "el\030\r \001(\t\022\024\n\014use_enhanced\030\016 \001(\010\"\232\001\n\rAudio" - + "Encoding\022\030\n\024ENCODING_UNSPECIFIED\020\000\022\014\n\010LI" - + "NEAR16\020\001\022\010\n\004FLAC\020\002\022\t\n\005MULAW\020\003\022\007\n\003AMR\020\004\022\n" - + "\n\006AMR_WB\020\005\022\014\n\010OGG_OPUS\020\006\022\032\n\026SPEEX_WITH_H" - + "EADER_BYTE\020\007\022\r\n\tWEBM_OPUS\020\t\"\221\001\n\030SpeakerD" - + "iarizationConfig\022\"\n\032enable_speaker_diari" - + "zation\030\001 \001(\010\022\031\n\021min_speaker_count\030\002 \001(\005\022" - + "\031\n\021max_speaker_count\030\003 \001(\005\022\033\n\013speaker_ta" - + "g\030\005 \001(\005B\006\030\001\342A\001\003\"\244\010\n\023RecognitionMetadata\022" - + "U\n\020interaction_type\030\001 \001(\0162;.google.cloud" - + ".speech.v1.RecognitionMetadata.Interacti" - + "onType\022$\n\034industry_naics_code_of_audio\030\003" - + " \001(\r\022[\n\023microphone_distance\030\004 \001(\0162>.goog" - + "le.cloud.speech.v1.RecognitionMetadata.M" - + "icrophoneDistance\022Z\n\023original_media_type" - + "\030\005 \001(\0162=.google.cloud.speech.v1.Recognit" - + "ionMetadata.OriginalMediaType\022^\n\025recordi" - + "ng_device_type\030\006 \001(\0162?.google.cloud.spee" - + "ch.v1.RecognitionMetadata.RecordingDevic" - + "eType\022\035\n\025recording_device_name\030\007 \001(\t\022\032\n\022" - + "original_mime_type\030\010 \001(\t\022\023\n\013audio_topic\030" - + "\n \001(\t\"\305\001\n\017InteractionType\022 \n\034INTERACTION" - + "_TYPE_UNSPECIFIED\020\000\022\016\n\nDISCUSSION\020\001\022\020\n\014P" - + "RESENTATION\020\002\022\016\n\nPHONE_CALL\020\003\022\r\n\tVOICEMA" - + "IL\020\004\022\033\n\027PROFESSIONALLY_PRODUCED\020\005\022\020\n\014VOI" - + "CE_SEARCH\020\006\022\021\n\rVOICE_COMMAND\020\007\022\r\n\tDICTAT" - + "ION\020\010\"d\n\022MicrophoneDistance\022#\n\037MICROPHON" - + "E_DISTANCE_UNSPECIFIED\020\000\022\r\n\tNEARFIELD\020\001\022" - + "\014\n\010MIDFIELD\020\002\022\014\n\010FARFIELD\020\003\"N\n\021OriginalM" - + "ediaType\022#\n\037ORIGINAL_MEDIA_TYPE_UNSPECIF" - + "IED\020\000\022\t\n\005AUDIO\020\001\022\t\n\005VIDEO\020\002\"\244\001\n\023Recordin" - + "gDeviceType\022%\n!RECORDING_DEVICE_TYPE_UNS" - + "PECIFIED\020\000\022\016\n\nSMARTPHONE\020\001\022\006\n\002PC\020\002\022\016\n\nPH" - + "ONE_LINE\020\003\022\013\n\007VEHICLE\020\004\022\030\n\024OTHER_OUTDOOR" - + "_DEVICE\020\005\022\027\n\023OTHER_INDOOR_DEVICE\020\006:\002\030\001\"/" - + "\n\rSpeechContext\022\017\n\007phrases\030\001 \003(\t\022\r\n\005boos" - + "t\030\004 \001(\002\"D\n\020RecognitionAudio\022\021\n\007content\030\001" - + " \001(\014H\000\022\r\n\003uri\030\002 \001(\tH\000B\016\n\014audio_source\"\355\001" - + "\n\021RecognizeResponse\022@\n\007results\030\002 \003(\0132/.g" - + "oogle.cloud.speech.v1.SpeechRecognitionR" - + "esult\0224\n\021total_billed_time\030\003 \001(\0132\031.googl" - + "e.protobuf.Duration\022L\n\026speech_adaptation" - + "_info\030\007 \001(\0132,.google.cloud.speech.v1.Spe" - + "echAdaptationInfo\022\022\n\nrequest_id\030\010 \001(\003\"\351\002" - + "\n\034LongRunningRecognizeResponse\022@\n\007result" - + "s\030\002 \003(\0132/.google.cloud.speech.v1.SpeechR" - + "ecognitionResult\0224\n\021total_billed_time\030\003 " - + "\001(\0132\031.google.protobuf.Duration\022E\n\routput" - + "_config\030\006 \001(\0132..google.cloud.speech.v1.T" - + "ranscriptOutputConfig\022(\n\014output_error\030\007 " - + "\001(\0132\022.google.rpc.Status\022L\n\026speech_adapta" - + "tion_info\030\010 \001(\0132,.google.cloud.speech.v1" - + ".SpeechAdaptationInfo\022\022\n\nrequest_id\030\t \001(" - + "\003\"\261\001\n\034LongRunningRecognizeMetadata\022\030\n\020pr" - + "ogress_percent\030\001 \001(\005\022.\n\nstart_time\030\002 \001(\013" - + "2\032.google.protobuf.Timestamp\0224\n\020last_upd" - + "ate_time\030\003 \001(\0132\032.google.protobuf.Timesta" - + "mp\022\021\n\003uri\030\004 \001(\tB\004\342A\001\003\"\321\004\n\032StreamingRecog" - + "nizeResponse\022!\n\005error\030\001 \001(\0132\022.google.rpc" - + ".Status\022C\n\007results\030\002 \003(\01322.google.cloud." - + "speech.v1.StreamingRecognitionResult\022]\n\021" - + "speech_event_type\030\004 \001(\0162B.google.cloud.s" - + "peech.v1.StreamingRecognizeResponse.Spee" - + "chEventType\0224\n\021speech_event_time\030\010 \001(\0132\031" - + ".google.protobuf.Duration\0224\n\021total_bille" - + "d_time\030\005 \001(\0132\031.google.protobuf.Duration\022" - + "L\n\026speech_adaptation_info\030\t \001(\0132,.google" - + ".cloud.speech.v1.SpeechAdaptationInfo\022\022\n" - + "\nrequest_id\030\n \001(\003\"\235\001\n\017SpeechEventType\022\034\n" - + "\030SPEECH_EVENT_UNSPECIFIED\020\000\022\033\n\027END_OF_SI" - + "NGLE_UTTERANCE\020\001\022\031\n\025SPEECH_ACTIVITY_BEGI" - + "N\020\002\022\027\n\023SPEECH_ACTIVITY_END\020\003\022\033\n\027SPEECH_A" - + "CTIVITY_TIMEOUT\020\004\"\363\001\n\032StreamingRecogniti" - + "onResult\022J\n\014alternatives\030\001 \003(\01324.google." - + "cloud.speech.v1.SpeechRecognitionAlterna" - + "tive\022\020\n\010is_final\030\002 \001(\010\022\021\n\tstability\030\003 \001(" - + "\002\0222\n\017result_end_time\030\004 \001(\0132\031.google.prot" - + "obuf.Duration\022\023\n\013channel_tag\030\005 \001(\005\022\033\n\rla" - + "nguage_code\030\006 \001(\tB\004\342A\001\003\"\313\001\n\027SpeechRecogn" - + "itionResult\022J\n\014alternatives\030\001 \003(\01324.goog" - + "le.cloud.speech.v1.SpeechRecognitionAlte" - + "rnative\022\023\n\013channel_tag\030\002 \001(\005\0222\n\017result_e" - + "nd_time\030\004 \001(\0132\031.google.protobuf.Duration" - + "\022\033\n\rlanguage_code\030\005 \001(\tB\004\342A\001\003\"w\n\034SpeechR" - + "ecognitionAlternative\022\022\n\ntranscript\030\001 \001(" - + "\t\022\022\n\nconfidence\030\002 \001(\002\022/\n\005words\030\003 \003(\0132 .g" - + "oogle.cloud.speech.v1.WordInfo\"\243\001\n\010WordI" - + "nfo\022-\n\nstart_time\030\001 \001(\0132\031.google.protobu" - + "f.Duration\022+\n\010end_time\030\002 \001(\0132\031.google.pr" - + "otobuf.Duration\022\014\n\004word\030\003 \001(\t\022\022\n\nconfide" - + "nce\030\004 \001(\002\022\031\n\013speaker_tag\030\005 \001(\005B\004\342A\001\003\"K\n\024" - + "SpeechAdaptationInfo\022\032\n\022adaptation_timeo" - + "ut\030\001 \001(\010\022\027\n\017timeout_message\030\004 \001(\t2\321\004\n\006Sp" - + "eech\022\220\001\n\tRecognize\022(.google.cloud.speech" - + ".v1.RecognizeRequest\032).google.cloud.spee" - + "ch.v1.RecognizeResponse\".\332A\014config,audio" - + "\202\323\344\223\002\031\"\024/v1/speech:recognize:\001*\022\344\001\n\024Long" - + "RunningRecognize\0223.google.cloud.speech.v" - + "1.LongRunningRecognizeRequest\032\035.google.l" - + "ongrunning.Operation\"x\312A<\n\034LongRunningRe" - + "cognizeResponse\022\034LongRunningRecognizeMet" - + "adata\332A\014config,audio\202\323\344\223\002$\"\037/v1/speech:l" - + "ongrunningrecognize:\001*\022\201\001\n\022StreamingReco" - + "gnize\0221.google.cloud.speech.v1.Streaming" - + "RecognizeRequest\0322.google.cloud.speech.v" - + "1.StreamingRecognizeResponse\"\000(\0010\001\032I\312A\025s" - + "peech.googleapis.com\322A.https://www.googl" - + "eapis.com/auth/cloud-platformBh\n\032com.goo" - + "gle.cloud.speech.v1B\013SpeechProtoP\001Z2clou" - + "d.google.com/go/speech/apiv1/speechpb;sp" - + "eechpb\370\001\001\242\002\003GCSb\006proto3" + + "ion\022W\n\030transcript_normalization\030\030 \001(\0132/." + + "google.cloud.speech.v1.TranscriptNormali" + + "zationB\004\342A\001\001\022>\n\017speech_contexts\030\006 \003(\0132%." + + "google.cloud.speech.v1.SpeechContext\022 \n\030" + + "enable_word_time_offsets\030\010 \001(\010\022\036\n\026enable" + + "_word_confidence\030\017 \001(\010\022$\n\034enable_automat" + + "ic_punctuation\030\013 \001(\010\022=\n\031enable_spoken_pu" + + "nctuation\030\026 \001(\0132\032.google.protobuf.BoolVa" + + "lue\0228\n\024enable_spoken_emojis\030\027 \001(\0132\032.goog" + + "le.protobuf.BoolValue\022L\n\022diarization_con" + + "fig\030\023 \001(\01320.google.cloud.speech.v1.Speak" + + "erDiarizationConfig\022=\n\010metadata\030\t \001(\0132+." + + "google.cloud.speech.v1.RecognitionMetada" + + "ta\022\r\n\005model\030\r \001(\t\022\024\n\014use_enhanced\030\016 \001(\010\"" + + "\243\001\n\rAudioEncoding\022\030\n\024ENCODING_UNSPECIFIE" + + "D\020\000\022\014\n\010LINEAR16\020\001\022\010\n\004FLAC\020\002\022\t\n\005MULAW\020\003\022\007" + + "\n\003AMR\020\004\022\n\n\006AMR_WB\020\005\022\014\n\010OGG_OPUS\020\006\022\032\n\026SPE" + + "EX_WITH_HEADER_BYTE\020\007\022\007\n\003MP3\020\010\022\r\n\tWEBM_O" + + "PUS\020\t\"\221\001\n\030SpeakerDiarizationConfig\022\"\n\032en" + + "able_speaker_diarization\030\001 \001(\010\022\031\n\021min_sp" + + "eaker_count\030\002 \001(\005\022\031\n\021max_speaker_count\030\003" + + " \001(\005\022\033\n\013speaker_tag\030\005 \001(\005B\006\030\001\342A\001\003\"\244\010\n\023Re" + + "cognitionMetadata\022U\n\020interaction_type\030\001 " + + "\001(\0162;.google.cloud.speech.v1.Recognition" + + "Metadata.InteractionType\022$\n\034industry_nai" + + "cs_code_of_audio\030\003 \001(\r\022[\n\023microphone_dis" + + "tance\030\004 \001(\0162>.google.cloud.speech.v1.Rec" + + "ognitionMetadata.MicrophoneDistance\022Z\n\023o" + + "riginal_media_type\030\005 \001(\0162=.google.cloud." + + "speech.v1.RecognitionMetadata.OriginalMe" + + "diaType\022^\n\025recording_device_type\030\006 \001(\0162?" + + ".google.cloud.speech.v1.RecognitionMetad" + + "ata.RecordingDeviceType\022\035\n\025recording_dev" + + "ice_name\030\007 \001(\t\022\032\n\022original_mime_type\030\010 \001" + + "(\t\022\023\n\013audio_topic\030\n \001(\t\"\305\001\n\017InteractionT" + + "ype\022 \n\034INTERACTION_TYPE_UNSPECIFIED\020\000\022\016\n" + + "\nDISCUSSION\020\001\022\020\n\014PRESENTATION\020\002\022\016\n\nPHONE" + + "_CALL\020\003\022\r\n\tVOICEMAIL\020\004\022\033\n\027PROFESSIONALLY" + + "_PRODUCED\020\005\022\020\n\014VOICE_SEARCH\020\006\022\021\n\rVOICE_C" + + "OMMAND\020\007\022\r\n\tDICTATION\020\010\"d\n\022MicrophoneDis" + + "tance\022#\n\037MICROPHONE_DISTANCE_UNSPECIFIED" + + "\020\000\022\r\n\tNEARFIELD\020\001\022\014\n\010MIDFIELD\020\002\022\014\n\010FARFI" + + "ELD\020\003\"N\n\021OriginalMediaType\022#\n\037ORIGINAL_M" + + "EDIA_TYPE_UNSPECIFIED\020\000\022\t\n\005AUDIO\020\001\022\t\n\005VI" + + "DEO\020\002\"\244\001\n\023RecordingDeviceType\022%\n!RECORDI" + + "NG_DEVICE_TYPE_UNSPECIFIED\020\000\022\016\n\nSMARTPHO" + + "NE\020\001\022\006\n\002PC\020\002\022\016\n\nPHONE_LINE\020\003\022\013\n\007VEHICLE\020" + + "\004\022\030\n\024OTHER_OUTDOOR_DEVICE\020\005\022\027\n\023OTHER_IND" + + "OOR_DEVICE\020\006:\002\030\001\"/\n\rSpeechContext\022\017\n\007phr" + + "ases\030\001 \003(\t\022\r\n\005boost\030\004 \001(\002\"D\n\020Recognition" + + "Audio\022\021\n\007content\030\001 \001(\014H\000\022\r\n\003uri\030\002 \001(\tH\000B" + + "\016\n\014audio_source\"\355\001\n\021RecognizeResponse\022@\n" + + "\007results\030\002 \003(\0132/.google.cloud.speech.v1." + + "SpeechRecognitionResult\0224\n\021total_billed_" + + "time\030\003 \001(\0132\031.google.protobuf.Duration\022L\n" + + "\026speech_adaptation_info\030\007 \001(\0132,.google.c" + + "loud.speech.v1.SpeechAdaptationInfo\022\022\n\nr" + + "equest_id\030\010 \001(\003\"\351\002\n\034LongRunningRecognize" + + "Response\022@\n\007results\030\002 \003(\0132/.google.cloud" + + ".speech.v1.SpeechRecognitionResult\0224\n\021to" + + "tal_billed_time\030\003 \001(\0132\031.google.protobuf." + + "Duration\022E\n\routput_config\030\006 \001(\0132..google" + + ".cloud.speech.v1.TranscriptOutputConfig\022" + + "(\n\014output_error\030\007 \001(\0132\022.google.rpc.Statu" + + "s\022L\n\026speech_adaptation_info\030\010 \001(\0132,.goog" + + "le.cloud.speech.v1.SpeechAdaptationInfo\022" + + "\022\n\nrequest_id\030\t \001(\003\"\261\001\n\034LongRunningRecog" + + "nizeMetadata\022\030\n\020progress_percent\030\001 \001(\005\022." + + "\n\nstart_time\030\002 \001(\0132\032.google.protobuf.Tim" + + "estamp\0224\n\020last_update_time\030\003 \001(\0132\032.googl" + + "e.protobuf.Timestamp\022\021\n\003uri\030\004 \001(\tB\004\342A\001\003\"" + + "\321\004\n\032StreamingRecognizeResponse\022!\n\005error\030" + + "\001 \001(\0132\022.google.rpc.Status\022C\n\007results\030\002 \003" + + "(\01322.google.cloud.speech.v1.StreamingRec" + + "ognitionResult\022]\n\021speech_event_type\030\004 \001(" + + "\0162B.google.cloud.speech.v1.StreamingReco" + + "gnizeResponse.SpeechEventType\0224\n\021speech_" + + "event_time\030\010 \001(\0132\031.google.protobuf.Durat" + + "ion\0224\n\021total_billed_time\030\005 \001(\0132\031.google." + + "protobuf.Duration\022L\n\026speech_adaptation_i" + + "nfo\030\t \001(\0132,.google.cloud.speech.v1.Speec" + + "hAdaptationInfo\022\022\n\nrequest_id\030\n \001(\003\"\235\001\n\017" + + "SpeechEventType\022\034\n\030SPEECH_EVENT_UNSPECIF" + + "IED\020\000\022\033\n\027END_OF_SINGLE_UTTERANCE\020\001\022\031\n\025SP" + + "EECH_ACTIVITY_BEGIN\020\002\022\027\n\023SPEECH_ACTIVITY" + + "_END\020\003\022\033\n\027SPEECH_ACTIVITY_TIMEOUT\020\004\"\363\001\n\032" + + "StreamingRecognitionResult\022J\n\014alternativ" + + "es\030\001 \003(\01324.google.cloud.speech.v1.Speech" + + "RecognitionAlternative\022\020\n\010is_final\030\002 \001(\010" + + "\022\021\n\tstability\030\003 \001(\002\0222\n\017result_end_time\030\004" + + " \001(\0132\031.google.protobuf.Duration\022\023\n\013chann" + + "el_tag\030\005 \001(\005\022\033\n\rlanguage_code\030\006 \001(\tB\004\342A\001" + + "\003\"\313\001\n\027SpeechRecognitionResult\022J\n\014alterna" + + "tives\030\001 \003(\01324.google.cloud.speech.v1.Spe" + + "echRecognitionAlternative\022\023\n\013channel_tag" + + "\030\002 \001(\005\0222\n\017result_end_time\030\004 \001(\0132\031.google" + + ".protobuf.Duration\022\033\n\rlanguage_code\030\005 \001(" + + "\tB\004\342A\001\003\"w\n\034SpeechRecognitionAlternative\022" + + "\022\n\ntranscript\030\001 \001(\t\022\022\n\nconfidence\030\002 \001(\002\022" + + "/\n\005words\030\003 \003(\0132 .google.cloud.speech.v1." + + "WordInfo\"\302\001\n\010WordInfo\022-\n\nstart_time\030\001 \001(" + + "\0132\031.google.protobuf.Duration\022+\n\010end_time" + + "\030\002 \001(\0132\031.google.protobuf.Duration\022\014\n\004wor" + + "d\030\003 \001(\t\022\022\n\nconfidence\030\004 \001(\002\022\033\n\013speaker_t" + + "ag\030\005 \001(\005B\006\030\001\342A\001\003\022\033\n\rspeaker_label\030\006 \001(\tB" + + "\004\342A\001\003\"K\n\024SpeechAdaptationInfo\022\032\n\022adaptat" + + "ion_timeout\030\001 \001(\010\022\027\n\017timeout_message\030\004 \001" + + "(\t2\321\004\n\006Speech\022\220\001\n\tRecognize\022(.google.clo" + + "ud.speech.v1.RecognizeRequest\032).google.c" + + "loud.speech.v1.RecognizeResponse\".\332A\014con" + + "fig,audio\202\323\344\223\002\031\"\024/v1/speech:recognize:\001*" + + "\022\344\001\n\024LongRunningRecognize\0223.google.cloud" + + ".speech.v1.LongRunningRecognizeRequest\032\035" + + ".google.longrunning.Operation\"x\312A<\n\034Long" + + "RunningRecognizeResponse\022\034LongRunningRec" + + "ognizeMetadata\332A\014config,audio\202\323\344\223\002$\"\037/v1" + + "/speech:longrunningrecognize:\001*\022\201\001\n\022Stre" + + "amingRecognize\0221.google.cloud.speech.v1." + + "StreamingRecognizeRequest\0322.google.cloud" + + ".speech.v1.StreamingRecognizeResponse\"\000(" + + "\0010\001\032I\312A\025speech.googleapis.com\322A.https://" + + "www.googleapis.com/auth/cloud-platformBh" + + "\n\032com.google.cloud.speech.v1B\013SpeechProt" + + "oP\001Z2cloud.google.com/go/speech/apiv1/sp" + + "eechpb;speechpb\370\001\001\242\002\003GCSb\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -366,6 +369,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "MaxAlternatives", "ProfanityFilter", "Adaptation", + "TranscriptNormalization", "SpeechContexts", "EnableWordTimeOffsets", "EnableWordConfidence", @@ -489,7 +493,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_speech_v1_WordInfo_descriptor, new java.lang.String[] { - "StartTime", "EndTime", "Word", "Confidence", "SpeakerTag", + "StartTime", "EndTime", "Word", "Confidence", "SpeakerTag", "SpeakerLabel", }); internal_static_google_cloud_speech_v1_SpeechAdaptationInfo_descriptor = getDescriptor().getMessageTypes().get(18); diff --git a/java-speech/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechResourceProto.java b/java-speech/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechResourceProto.java index b17381a857d9..185311c21b08 100644 --- a/java-speech/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechResourceProto.java +++ b/java-speech/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechResourceProto.java @@ -51,6 +51,14 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_speech_v1_SpeechAdaptation_ABNFGrammar_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_speech_v1_SpeechAdaptation_ABNFGrammar_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_speech_v1_TranscriptNormalization_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_speech_v1_TranscriptNormalization_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_speech_v1_TranscriptNormalization_Entry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_speech_v1_TranscriptNormalization_Entry_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { return descriptor; @@ -82,10 +90,14 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "2#.google.cloud.speech.v1.CustomClass\022J\n" + "\014abnf_grammar\030\004 \001(\01324.google.cloud.speec" + "h.v1.SpeechAdaptation.ABNFGrammar\032#\n\013ABN" - + "FGrammar\022\024\n\014abnf_strings\030\001 \003(\tBp\n\032com.go" - + "ogle.cloud.speech.v1B\023SpeechResourceProt" - + "oP\001Z2cloud.google.com/go/speech/apiv1/sp" - + "eechpb;speechpb\370\001\001\242\002\003GCSb\006proto3" + + "FGrammar\022\024\n\014abnf_strings\030\001 \003(\t\"\243\001\n\027Trans" + + "criptNormalization\022F\n\007entries\030\001 \003(\01325.go" + + "ogle.cloud.speech.v1.TranscriptNormaliza" + + "tion.Entry\032@\n\005Entry\022\016\n\006search\030\001 \001(\t\022\017\n\007r" + + "eplace\030\002 \001(\t\022\026\n\016case_sensitive\030\003 \001(\010Bp\n\032" + + "com.google.cloud.speech.v1B\023SpeechResour" + + "ceProtoP\001Z2cloud.google.com/go/speech/ap" + + "iv1/speechpb;speechpb\370\001\001\242\002\003GCSb\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -141,6 +153,24 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new java.lang.String[] { "AbnfStrings", }); + internal_static_google_cloud_speech_v1_TranscriptNormalization_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_speech_v1_TranscriptNormalization_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_speech_v1_TranscriptNormalization_descriptor, + new java.lang.String[] { + "Entries", + }); + internal_static_google_cloud_speech_v1_TranscriptNormalization_Entry_descriptor = + internal_static_google_cloud_speech_v1_TranscriptNormalization_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_speech_v1_TranscriptNormalization_Entry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_speech_v1_TranscriptNormalization_Entry_descriptor, + new java.lang.String[] { + "Search", "Replace", "CaseSensitive", + }); com.google.protobuf.ExtensionRegistry registry = com.google.protobuf.ExtensionRegistry.newInstance(); registry.add(com.google.api.ResourceProto.resource); diff --git a/java-speech/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/TranscriptNormalization.java b/java-speech/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/TranscriptNormalization.java new file mode 100644 index 000000000000..8a59e105ecf2 --- /dev/null +++ b/java-speech/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/TranscriptNormalization.java @@ -0,0 +1,1982 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1/resource.proto + +package com.google.cloud.speech.v1; + +/** + * + * + *
+ * Transcription normalization configuration. Use transcription normalization
+ * to automatically replace parts of the transcript with phrases of your
+ * choosing. For StreamingRecognize, this normalization only applies to stable
+ * partial transcripts (stability > 0.8) and final transcripts.
+ * 
+ * + * Protobuf type {@code google.cloud.speech.v1.TranscriptNormalization} + */ +public final class TranscriptNormalization extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.TranscriptNormalization) + TranscriptNormalizationOrBuilder { + private static final long serialVersionUID = 0L; + // Use TranscriptNormalization.newBuilder() to construct. + private TranscriptNormalization(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private TranscriptNormalization() { + entries_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new TranscriptNormalization(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.speech.v1.SpeechResourceProto + .internal_static_google_cloud_speech_v1_TranscriptNormalization_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1.SpeechResourceProto + .internal_static_google_cloud_speech_v1_TranscriptNormalization_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1.TranscriptNormalization.class, + com.google.cloud.speech.v1.TranscriptNormalization.Builder.class); + } + + public interface EntryOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1.TranscriptNormalization.Entry) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * What to replace. Max length is 100 characters.
+     * 
+ * + * string search = 1; + * + * @return The search. + */ + java.lang.String getSearch(); + /** + * + * + *
+     * What to replace. Max length is 100 characters.
+     * 
+ * + * string search = 1; + * + * @return The bytes for search. + */ + com.google.protobuf.ByteString getSearchBytes(); + + /** + * + * + *
+     * What to replace with. Max length is 100 characters.
+     * 
+ * + * string replace = 2; + * + * @return The replace. + */ + java.lang.String getReplace(); + /** + * + * + *
+     * What to replace with. Max length is 100 characters.
+     * 
+ * + * string replace = 2; + * + * @return The bytes for replace. + */ + com.google.protobuf.ByteString getReplaceBytes(); + + /** + * + * + *
+     * Whether the search is case sensitive.
+     * 
+ * + * bool case_sensitive = 3; + * + * @return The caseSensitive. + */ + boolean getCaseSensitive(); + } + /** + * + * + *
+   * A single replacement configuration.
+   * 
+ * + * Protobuf type {@code google.cloud.speech.v1.TranscriptNormalization.Entry} + */ + public static final class Entry extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.TranscriptNormalization.Entry) + EntryOrBuilder { + private static final long serialVersionUID = 0L; + // Use Entry.newBuilder() to construct. + private Entry(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Entry() { + search_ = ""; + replace_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Entry(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.speech.v1.SpeechResourceProto + .internal_static_google_cloud_speech_v1_TranscriptNormalization_Entry_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1.SpeechResourceProto + .internal_static_google_cloud_speech_v1_TranscriptNormalization_Entry_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1.TranscriptNormalization.Entry.class, + com.google.cloud.speech.v1.TranscriptNormalization.Entry.Builder.class); + } + + public static final int SEARCH_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object search_ = ""; + /** + * + * + *
+     * What to replace. Max length is 100 characters.
+     * 
+ * + * string search = 1; + * + * @return The search. + */ + @java.lang.Override + public java.lang.String getSearch() { + java.lang.Object ref = search_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + search_ = s; + return s; + } + } + /** + * + * + *
+     * What to replace. Max length is 100 characters.
+     * 
+ * + * string search = 1; + * + * @return The bytes for search. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSearchBytes() { + java.lang.Object ref = search_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + search_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REPLACE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object replace_ = ""; + /** + * + * + *
+     * What to replace with. Max length is 100 characters.
+     * 
+ * + * string replace = 2; + * + * @return The replace. + */ + @java.lang.Override + public java.lang.String getReplace() { + java.lang.Object ref = replace_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + replace_ = s; + return s; + } + } + /** + * + * + *
+     * What to replace with. Max length is 100 characters.
+     * 
+ * + * string replace = 2; + * + * @return The bytes for replace. + */ + @java.lang.Override + public com.google.protobuf.ByteString getReplaceBytes() { + java.lang.Object ref = replace_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + replace_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CASE_SENSITIVE_FIELD_NUMBER = 3; + private boolean caseSensitive_ = false; + /** + * + * + *
+     * Whether the search is case sensitive.
+     * 
+ * + * bool case_sensitive = 3; + * + * @return The caseSensitive. + */ + @java.lang.Override + public boolean getCaseSensitive() { + return caseSensitive_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(search_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, search_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(replace_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, replace_); + } + if (caseSensitive_ != false) { + output.writeBool(3, caseSensitive_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(search_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, search_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(replace_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, replace_); + } + if (caseSensitive_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, caseSensitive_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.speech.v1.TranscriptNormalization.Entry)) { + return super.equals(obj); + } + com.google.cloud.speech.v1.TranscriptNormalization.Entry other = + (com.google.cloud.speech.v1.TranscriptNormalization.Entry) obj; + + if (!getSearch().equals(other.getSearch())) return false; + if (!getReplace().equals(other.getReplace())) return false; + if (getCaseSensitive() != other.getCaseSensitive()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + SEARCH_FIELD_NUMBER; + hash = (53 * hash) + getSearch().hashCode(); + hash = (37 * hash) + REPLACE_FIELD_NUMBER; + hash = (53 * hash) + getReplace().hashCode(); + hash = (37 * hash) + CASE_SENSITIVE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getCaseSensitive()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.speech.v1.TranscriptNormalization.Entry parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.speech.v1.TranscriptNormalization.Entry parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.speech.v1.TranscriptNormalization.Entry parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.speech.v1.TranscriptNormalization.Entry parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.speech.v1.TranscriptNormalization.Entry parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.speech.v1.TranscriptNormalization.Entry parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.speech.v1.TranscriptNormalization.Entry parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.speech.v1.TranscriptNormalization.Entry parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.speech.v1.TranscriptNormalization.Entry parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.speech.v1.TranscriptNormalization.Entry parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.speech.v1.TranscriptNormalization.Entry parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.speech.v1.TranscriptNormalization.Entry parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.speech.v1.TranscriptNormalization.Entry prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * A single replacement configuration.
+     * 
+ * + * Protobuf type {@code google.cloud.speech.v1.TranscriptNormalization.Entry} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1.TranscriptNormalization.Entry) + com.google.cloud.speech.v1.TranscriptNormalization.EntryOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.speech.v1.SpeechResourceProto + .internal_static_google_cloud_speech_v1_TranscriptNormalization_Entry_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1.SpeechResourceProto + .internal_static_google_cloud_speech_v1_TranscriptNormalization_Entry_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1.TranscriptNormalization.Entry.class, + com.google.cloud.speech.v1.TranscriptNormalization.Entry.Builder.class); + } + + // Construct using com.google.cloud.speech.v1.TranscriptNormalization.Entry.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + search_ = ""; + replace_ = ""; + caseSensitive_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.speech.v1.SpeechResourceProto + .internal_static_google_cloud_speech_v1_TranscriptNormalization_Entry_descriptor; + } + + @java.lang.Override + public com.google.cloud.speech.v1.TranscriptNormalization.Entry getDefaultInstanceForType() { + return com.google.cloud.speech.v1.TranscriptNormalization.Entry.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.speech.v1.TranscriptNormalization.Entry build() { + com.google.cloud.speech.v1.TranscriptNormalization.Entry result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.speech.v1.TranscriptNormalization.Entry buildPartial() { + com.google.cloud.speech.v1.TranscriptNormalization.Entry result = + new com.google.cloud.speech.v1.TranscriptNormalization.Entry(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.speech.v1.TranscriptNormalization.Entry result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.search_ = search_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.replace_ = replace_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.caseSensitive_ = caseSensitive_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.speech.v1.TranscriptNormalization.Entry) { + return mergeFrom((com.google.cloud.speech.v1.TranscriptNormalization.Entry) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.speech.v1.TranscriptNormalization.Entry other) { + if (other == com.google.cloud.speech.v1.TranscriptNormalization.Entry.getDefaultInstance()) + return this; + if (!other.getSearch().isEmpty()) { + search_ = other.search_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getReplace().isEmpty()) { + replace_ = other.replace_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.getCaseSensitive() != false) { + setCaseSensitive(other.getCaseSensitive()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + search_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + replace_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + caseSensitive_ = input.readBool(); + bitField0_ |= 0x00000004; + break; + } // case 24 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object search_ = ""; + /** + * + * + *
+       * What to replace. Max length is 100 characters.
+       * 
+ * + * string search = 1; + * + * @return The search. + */ + public java.lang.String getSearch() { + java.lang.Object ref = search_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + search_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * What to replace. Max length is 100 characters.
+       * 
+ * + * string search = 1; + * + * @return The bytes for search. + */ + public com.google.protobuf.ByteString getSearchBytes() { + java.lang.Object ref = search_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + search_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * What to replace. Max length is 100 characters.
+       * 
+ * + * string search = 1; + * + * @param value The search to set. + * @return This builder for chaining. + */ + public Builder setSearch(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + search_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * What to replace. Max length is 100 characters.
+       * 
+ * + * string search = 1; + * + * @return This builder for chaining. + */ + public Builder clearSearch() { + search_ = getDefaultInstance().getSearch(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+       * What to replace. Max length is 100 characters.
+       * 
+ * + * string search = 1; + * + * @param value The bytes for search to set. + * @return This builder for chaining. + */ + public Builder setSearchBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + search_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object replace_ = ""; + /** + * + * + *
+       * What to replace with. Max length is 100 characters.
+       * 
+ * + * string replace = 2; + * + * @return The replace. + */ + public java.lang.String getReplace() { + java.lang.Object ref = replace_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + replace_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * What to replace with. Max length is 100 characters.
+       * 
+ * + * string replace = 2; + * + * @return The bytes for replace. + */ + public com.google.protobuf.ByteString getReplaceBytes() { + java.lang.Object ref = replace_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + replace_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * What to replace with. Max length is 100 characters.
+       * 
+ * + * string replace = 2; + * + * @param value The replace to set. + * @return This builder for chaining. + */ + public Builder setReplace(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + replace_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * What to replace with. Max length is 100 characters.
+       * 
+ * + * string replace = 2; + * + * @return This builder for chaining. + */ + public Builder clearReplace() { + replace_ = getDefaultInstance().getReplace(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+       * What to replace with. Max length is 100 characters.
+       * 
+ * + * string replace = 2; + * + * @param value The bytes for replace to set. + * @return This builder for chaining. + */ + public Builder setReplaceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + replace_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private boolean caseSensitive_; + /** + * + * + *
+       * Whether the search is case sensitive.
+       * 
+ * + * bool case_sensitive = 3; + * + * @return The caseSensitive. + */ + @java.lang.Override + public boolean getCaseSensitive() { + return caseSensitive_; + } + /** + * + * + *
+       * Whether the search is case sensitive.
+       * 
+ * + * bool case_sensitive = 3; + * + * @param value The caseSensitive to set. + * @return This builder for chaining. + */ + public Builder setCaseSensitive(boolean value) { + + caseSensitive_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+       * Whether the search is case sensitive.
+       * 
+ * + * bool case_sensitive = 3; + * + * @return This builder for chaining. + */ + public Builder clearCaseSensitive() { + bitField0_ = (bitField0_ & ~0x00000004); + caseSensitive_ = false; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1.TranscriptNormalization.Entry) + } + + // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.TranscriptNormalization.Entry) + private static final com.google.cloud.speech.v1.TranscriptNormalization.Entry DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.speech.v1.TranscriptNormalization.Entry(); + } + + public static com.google.cloud.speech.v1.TranscriptNormalization.Entry getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Entry parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.speech.v1.TranscriptNormalization.Entry getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int ENTRIES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List entries_; + /** + * + * + *
+   * A list of replacement entries. We will perform replacement with one entry
+   * at a time. For example, the second entry in ["cat" => "dog", "mountain cat"
+   * => "mountain dog"] will never be applied because we will always process the
+   * first entry before it. At most 100 entries.
+   * 
+ * + * repeated .google.cloud.speech.v1.TranscriptNormalization.Entry entries = 1; + */ + @java.lang.Override + public java.util.List getEntriesList() { + return entries_; + } + /** + * + * + *
+   * A list of replacement entries. We will perform replacement with one entry
+   * at a time. For example, the second entry in ["cat" => "dog", "mountain cat"
+   * => "mountain dog"] will never be applied because we will always process the
+   * first entry before it. At most 100 entries.
+   * 
+ * + * repeated .google.cloud.speech.v1.TranscriptNormalization.Entry entries = 1; + */ + @java.lang.Override + public java.util.List + getEntriesOrBuilderList() { + return entries_; + } + /** + * + * + *
+   * A list of replacement entries. We will perform replacement with one entry
+   * at a time. For example, the second entry in ["cat" => "dog", "mountain cat"
+   * => "mountain dog"] will never be applied because we will always process the
+   * first entry before it. At most 100 entries.
+   * 
+ * + * repeated .google.cloud.speech.v1.TranscriptNormalization.Entry entries = 1; + */ + @java.lang.Override + public int getEntriesCount() { + return entries_.size(); + } + /** + * + * + *
+   * A list of replacement entries. We will perform replacement with one entry
+   * at a time. For example, the second entry in ["cat" => "dog", "mountain cat"
+   * => "mountain dog"] will never be applied because we will always process the
+   * first entry before it. At most 100 entries.
+   * 
+ * + * repeated .google.cloud.speech.v1.TranscriptNormalization.Entry entries = 1; + */ + @java.lang.Override + public com.google.cloud.speech.v1.TranscriptNormalization.Entry getEntries(int index) { + return entries_.get(index); + } + /** + * + * + *
+   * A list of replacement entries. We will perform replacement with one entry
+   * at a time. For example, the second entry in ["cat" => "dog", "mountain cat"
+   * => "mountain dog"] will never be applied because we will always process the
+   * first entry before it. At most 100 entries.
+   * 
+ * + * repeated .google.cloud.speech.v1.TranscriptNormalization.Entry entries = 1; + */ + @java.lang.Override + public com.google.cloud.speech.v1.TranscriptNormalization.EntryOrBuilder getEntriesOrBuilder( + int index) { + return entries_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < entries_.size(); i++) { + output.writeMessage(1, entries_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < entries_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, entries_.get(i)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.speech.v1.TranscriptNormalization)) { + return super.equals(obj); + } + com.google.cloud.speech.v1.TranscriptNormalization other = + (com.google.cloud.speech.v1.TranscriptNormalization) obj; + + if (!getEntriesList().equals(other.getEntriesList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getEntriesCount() > 0) { + hash = (37 * hash) + ENTRIES_FIELD_NUMBER; + hash = (53 * hash) + getEntriesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.speech.v1.TranscriptNormalization parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.speech.v1.TranscriptNormalization parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.speech.v1.TranscriptNormalization parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.speech.v1.TranscriptNormalization parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.speech.v1.TranscriptNormalization parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.speech.v1.TranscriptNormalization parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.speech.v1.TranscriptNormalization parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.speech.v1.TranscriptNormalization parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.speech.v1.TranscriptNormalization parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.speech.v1.TranscriptNormalization parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.speech.v1.TranscriptNormalization parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.speech.v1.TranscriptNormalization parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.speech.v1.TranscriptNormalization prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Transcription normalization configuration. Use transcription normalization
+   * to automatically replace parts of the transcript with phrases of your
+   * choosing. For StreamingRecognize, this normalization only applies to stable
+   * partial transcripts (stability > 0.8) and final transcripts.
+   * 
+ * + * Protobuf type {@code google.cloud.speech.v1.TranscriptNormalization} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1.TranscriptNormalization) + com.google.cloud.speech.v1.TranscriptNormalizationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.speech.v1.SpeechResourceProto + .internal_static_google_cloud_speech_v1_TranscriptNormalization_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1.SpeechResourceProto + .internal_static_google_cloud_speech_v1_TranscriptNormalization_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1.TranscriptNormalization.class, + com.google.cloud.speech.v1.TranscriptNormalization.Builder.class); + } + + // Construct using com.google.cloud.speech.v1.TranscriptNormalization.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (entriesBuilder_ == null) { + entries_ = java.util.Collections.emptyList(); + } else { + entries_ = null; + entriesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.speech.v1.SpeechResourceProto + .internal_static_google_cloud_speech_v1_TranscriptNormalization_descriptor; + } + + @java.lang.Override + public com.google.cloud.speech.v1.TranscriptNormalization getDefaultInstanceForType() { + return com.google.cloud.speech.v1.TranscriptNormalization.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.speech.v1.TranscriptNormalization build() { + com.google.cloud.speech.v1.TranscriptNormalization result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.speech.v1.TranscriptNormalization buildPartial() { + com.google.cloud.speech.v1.TranscriptNormalization result = + new com.google.cloud.speech.v1.TranscriptNormalization(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.speech.v1.TranscriptNormalization result) { + if (entriesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + entries_ = java.util.Collections.unmodifiableList(entries_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.entries_ = entries_; + } else { + result.entries_ = entriesBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.speech.v1.TranscriptNormalization result) { + int from_bitField0_ = bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.speech.v1.TranscriptNormalization) { + return mergeFrom((com.google.cloud.speech.v1.TranscriptNormalization) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.speech.v1.TranscriptNormalization other) { + if (other == com.google.cloud.speech.v1.TranscriptNormalization.getDefaultInstance()) + return this; + if (entriesBuilder_ == null) { + if (!other.entries_.isEmpty()) { + if (entries_.isEmpty()) { + entries_ = other.entries_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureEntriesIsMutable(); + entries_.addAll(other.entries_); + } + onChanged(); + } + } else { + if (!other.entries_.isEmpty()) { + if (entriesBuilder_.isEmpty()) { + entriesBuilder_.dispose(); + entriesBuilder_ = null; + entries_ = other.entries_; + bitField0_ = (bitField0_ & ~0x00000001); + entriesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getEntriesFieldBuilder() + : null; + } else { + entriesBuilder_.addAllMessages(other.entries_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.speech.v1.TranscriptNormalization.Entry m = + input.readMessage( + com.google.cloud.speech.v1.TranscriptNormalization.Entry.parser(), + extensionRegistry); + if (entriesBuilder_ == null) { + ensureEntriesIsMutable(); + entries_.add(m); + } else { + entriesBuilder_.addMessage(m); + } + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List entries_ = + java.util.Collections.emptyList(); + + private void ensureEntriesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + entries_ = + new java.util.ArrayList( + entries_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.speech.v1.TranscriptNormalization.Entry, + com.google.cloud.speech.v1.TranscriptNormalization.Entry.Builder, + com.google.cloud.speech.v1.TranscriptNormalization.EntryOrBuilder> + entriesBuilder_; + + /** + * + * + *
+     * A list of replacement entries. We will perform replacement with one entry
+     * at a time. For example, the second entry in ["cat" => "dog", "mountain cat"
+     * => "mountain dog"] will never be applied because we will always process the
+     * first entry before it. At most 100 entries.
+     * 
+ * + * repeated .google.cloud.speech.v1.TranscriptNormalization.Entry entries = 1; + */ + public java.util.List + getEntriesList() { + if (entriesBuilder_ == null) { + return java.util.Collections.unmodifiableList(entries_); + } else { + return entriesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * A list of replacement entries. We will perform replacement with one entry
+     * at a time. For example, the second entry in ["cat" => "dog", "mountain cat"
+     * => "mountain dog"] will never be applied because we will always process the
+     * first entry before it. At most 100 entries.
+     * 
+ * + * repeated .google.cloud.speech.v1.TranscriptNormalization.Entry entries = 1; + */ + public int getEntriesCount() { + if (entriesBuilder_ == null) { + return entries_.size(); + } else { + return entriesBuilder_.getCount(); + } + } + /** + * + * + *
+     * A list of replacement entries. We will perform replacement with one entry
+     * at a time. For example, the second entry in ["cat" => "dog", "mountain cat"
+     * => "mountain dog"] will never be applied because we will always process the
+     * first entry before it. At most 100 entries.
+     * 
+ * + * repeated .google.cloud.speech.v1.TranscriptNormalization.Entry entries = 1; + */ + public com.google.cloud.speech.v1.TranscriptNormalization.Entry getEntries(int index) { + if (entriesBuilder_ == null) { + return entries_.get(index); + } else { + return entriesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * A list of replacement entries. We will perform replacement with one entry
+     * at a time. For example, the second entry in ["cat" => "dog", "mountain cat"
+     * => "mountain dog"] will never be applied because we will always process the
+     * first entry before it. At most 100 entries.
+     * 
+ * + * repeated .google.cloud.speech.v1.TranscriptNormalization.Entry entries = 1; + */ + public Builder setEntries( + int index, com.google.cloud.speech.v1.TranscriptNormalization.Entry value) { + if (entriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEntriesIsMutable(); + entries_.set(index, value); + onChanged(); + } else { + entriesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A list of replacement entries. We will perform replacement with one entry
+     * at a time. For example, the second entry in ["cat" => "dog", "mountain cat"
+     * => "mountain dog"] will never be applied because we will always process the
+     * first entry before it. At most 100 entries.
+     * 
+ * + * repeated .google.cloud.speech.v1.TranscriptNormalization.Entry entries = 1; + */ + public Builder setEntries( + int index, + com.google.cloud.speech.v1.TranscriptNormalization.Entry.Builder builderForValue) { + if (entriesBuilder_ == null) { + ensureEntriesIsMutable(); + entries_.set(index, builderForValue.build()); + onChanged(); + } else { + entriesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of replacement entries. We will perform replacement with one entry
+     * at a time. For example, the second entry in ["cat" => "dog", "mountain cat"
+     * => "mountain dog"] will never be applied because we will always process the
+     * first entry before it. At most 100 entries.
+     * 
+ * + * repeated .google.cloud.speech.v1.TranscriptNormalization.Entry entries = 1; + */ + public Builder addEntries(com.google.cloud.speech.v1.TranscriptNormalization.Entry value) { + if (entriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEntriesIsMutable(); + entries_.add(value); + onChanged(); + } else { + entriesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * A list of replacement entries. We will perform replacement with one entry
+     * at a time. For example, the second entry in ["cat" => "dog", "mountain cat"
+     * => "mountain dog"] will never be applied because we will always process the
+     * first entry before it. At most 100 entries.
+     * 
+ * + * repeated .google.cloud.speech.v1.TranscriptNormalization.Entry entries = 1; + */ + public Builder addEntries( + int index, com.google.cloud.speech.v1.TranscriptNormalization.Entry value) { + if (entriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEntriesIsMutable(); + entries_.add(index, value); + onChanged(); + } else { + entriesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A list of replacement entries. We will perform replacement with one entry
+     * at a time. For example, the second entry in ["cat" => "dog", "mountain cat"
+     * => "mountain dog"] will never be applied because we will always process the
+     * first entry before it. At most 100 entries.
+     * 
+ * + * repeated .google.cloud.speech.v1.TranscriptNormalization.Entry entries = 1; + */ + public Builder addEntries( + com.google.cloud.speech.v1.TranscriptNormalization.Entry.Builder builderForValue) { + if (entriesBuilder_ == null) { + ensureEntriesIsMutable(); + entries_.add(builderForValue.build()); + onChanged(); + } else { + entriesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of replacement entries. We will perform replacement with one entry
+     * at a time. For example, the second entry in ["cat" => "dog", "mountain cat"
+     * => "mountain dog"] will never be applied because we will always process the
+     * first entry before it. At most 100 entries.
+     * 
+ * + * repeated .google.cloud.speech.v1.TranscriptNormalization.Entry entries = 1; + */ + public Builder addEntries( + int index, + com.google.cloud.speech.v1.TranscriptNormalization.Entry.Builder builderForValue) { + if (entriesBuilder_ == null) { + ensureEntriesIsMutable(); + entries_.add(index, builderForValue.build()); + onChanged(); + } else { + entriesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of replacement entries. We will perform replacement with one entry
+     * at a time. For example, the second entry in ["cat" => "dog", "mountain cat"
+     * => "mountain dog"] will never be applied because we will always process the
+     * first entry before it. At most 100 entries.
+     * 
+ * + * repeated .google.cloud.speech.v1.TranscriptNormalization.Entry entries = 1; + */ + public Builder addAllEntries( + java.lang.Iterable + values) { + if (entriesBuilder_ == null) { + ensureEntriesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, entries_); + onChanged(); + } else { + entriesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * A list of replacement entries. We will perform replacement with one entry
+     * at a time. For example, the second entry in ["cat" => "dog", "mountain cat"
+     * => "mountain dog"] will never be applied because we will always process the
+     * first entry before it. At most 100 entries.
+     * 
+ * + * repeated .google.cloud.speech.v1.TranscriptNormalization.Entry entries = 1; + */ + public Builder clearEntries() { + if (entriesBuilder_ == null) { + entries_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + entriesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A list of replacement entries. We will perform replacement with one entry
+     * at a time. For example, the second entry in ["cat" => "dog", "mountain cat"
+     * => "mountain dog"] will never be applied because we will always process the
+     * first entry before it. At most 100 entries.
+     * 
+ * + * repeated .google.cloud.speech.v1.TranscriptNormalization.Entry entries = 1; + */ + public Builder removeEntries(int index) { + if (entriesBuilder_ == null) { + ensureEntriesIsMutable(); + entries_.remove(index); + onChanged(); + } else { + entriesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * A list of replacement entries. We will perform replacement with one entry
+     * at a time. For example, the second entry in ["cat" => "dog", "mountain cat"
+     * => "mountain dog"] will never be applied because we will always process the
+     * first entry before it. At most 100 entries.
+     * 
+ * + * repeated .google.cloud.speech.v1.TranscriptNormalization.Entry entries = 1; + */ + public com.google.cloud.speech.v1.TranscriptNormalization.Entry.Builder getEntriesBuilder( + int index) { + return getEntriesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * A list of replacement entries. We will perform replacement with one entry
+     * at a time. For example, the second entry in ["cat" => "dog", "mountain cat"
+     * => "mountain dog"] will never be applied because we will always process the
+     * first entry before it. At most 100 entries.
+     * 
+ * + * repeated .google.cloud.speech.v1.TranscriptNormalization.Entry entries = 1; + */ + public com.google.cloud.speech.v1.TranscriptNormalization.EntryOrBuilder getEntriesOrBuilder( + int index) { + if (entriesBuilder_ == null) { + return entries_.get(index); + } else { + return entriesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * A list of replacement entries. We will perform replacement with one entry
+     * at a time. For example, the second entry in ["cat" => "dog", "mountain cat"
+     * => "mountain dog"] will never be applied because we will always process the
+     * first entry before it. At most 100 entries.
+     * 
+ * + * repeated .google.cloud.speech.v1.TranscriptNormalization.Entry entries = 1; + */ + public java.util.List< + ? extends com.google.cloud.speech.v1.TranscriptNormalization.EntryOrBuilder> + getEntriesOrBuilderList() { + if (entriesBuilder_ != null) { + return entriesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(entries_); + } + } + /** + * + * + *
+     * A list of replacement entries. We will perform replacement with one entry
+     * at a time. For example, the second entry in ["cat" => "dog", "mountain cat"
+     * => "mountain dog"] will never be applied because we will always process the
+     * first entry before it. At most 100 entries.
+     * 
+ * + * repeated .google.cloud.speech.v1.TranscriptNormalization.Entry entries = 1; + */ + public com.google.cloud.speech.v1.TranscriptNormalization.Entry.Builder addEntriesBuilder() { + return getEntriesFieldBuilder() + .addBuilder( + com.google.cloud.speech.v1.TranscriptNormalization.Entry.getDefaultInstance()); + } + /** + * + * + *
+     * A list of replacement entries. We will perform replacement with one entry
+     * at a time. For example, the second entry in ["cat" => "dog", "mountain cat"
+     * => "mountain dog"] will never be applied because we will always process the
+     * first entry before it. At most 100 entries.
+     * 
+ * + * repeated .google.cloud.speech.v1.TranscriptNormalization.Entry entries = 1; + */ + public com.google.cloud.speech.v1.TranscriptNormalization.Entry.Builder addEntriesBuilder( + int index) { + return getEntriesFieldBuilder() + .addBuilder( + index, com.google.cloud.speech.v1.TranscriptNormalization.Entry.getDefaultInstance()); + } + /** + * + * + *
+     * A list of replacement entries. We will perform replacement with one entry
+     * at a time. For example, the second entry in ["cat" => "dog", "mountain cat"
+     * => "mountain dog"] will never be applied because we will always process the
+     * first entry before it. At most 100 entries.
+     * 
+ * + * repeated .google.cloud.speech.v1.TranscriptNormalization.Entry entries = 1; + */ + public java.util.List + getEntriesBuilderList() { + return getEntriesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.speech.v1.TranscriptNormalization.Entry, + com.google.cloud.speech.v1.TranscriptNormalization.Entry.Builder, + com.google.cloud.speech.v1.TranscriptNormalization.EntryOrBuilder> + getEntriesFieldBuilder() { + if (entriesBuilder_ == null) { + entriesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.speech.v1.TranscriptNormalization.Entry, + com.google.cloud.speech.v1.TranscriptNormalization.Entry.Builder, + com.google.cloud.speech.v1.TranscriptNormalization.EntryOrBuilder>( + entries_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + entries_ = null; + } + return entriesBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1.TranscriptNormalization) + } + + // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.TranscriptNormalization) + private static final com.google.cloud.speech.v1.TranscriptNormalization DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.speech.v1.TranscriptNormalization(); + } + + public static com.google.cloud.speech.v1.TranscriptNormalization getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TranscriptNormalization parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.speech.v1.TranscriptNormalization getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-speech/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/TranscriptNormalizationOrBuilder.java b/java-speech/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/TranscriptNormalizationOrBuilder.java new file mode 100644 index 000000000000..6632d2bdd78c --- /dev/null +++ b/java-speech/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/TranscriptNormalizationOrBuilder.java @@ -0,0 +1,92 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1/resource.proto + +package com.google.cloud.speech.v1; + +public interface TranscriptNormalizationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1.TranscriptNormalization) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A list of replacement entries. We will perform replacement with one entry
+   * at a time. For example, the second entry in ["cat" => "dog", "mountain cat"
+   * => "mountain dog"] will never be applied because we will always process the
+   * first entry before it. At most 100 entries.
+   * 
+ * + * repeated .google.cloud.speech.v1.TranscriptNormalization.Entry entries = 1; + */ + java.util.List getEntriesList(); + /** + * + * + *
+   * A list of replacement entries. We will perform replacement with one entry
+   * at a time. For example, the second entry in ["cat" => "dog", "mountain cat"
+   * => "mountain dog"] will never be applied because we will always process the
+   * first entry before it. At most 100 entries.
+   * 
+ * + * repeated .google.cloud.speech.v1.TranscriptNormalization.Entry entries = 1; + */ + com.google.cloud.speech.v1.TranscriptNormalization.Entry getEntries(int index); + /** + * + * + *
+   * A list of replacement entries. We will perform replacement with one entry
+   * at a time. For example, the second entry in ["cat" => "dog", "mountain cat"
+   * => "mountain dog"] will never be applied because we will always process the
+   * first entry before it. At most 100 entries.
+   * 
+ * + * repeated .google.cloud.speech.v1.TranscriptNormalization.Entry entries = 1; + */ + int getEntriesCount(); + /** + * + * + *
+   * A list of replacement entries. We will perform replacement with one entry
+   * at a time. For example, the second entry in ["cat" => "dog", "mountain cat"
+   * => "mountain dog"] will never be applied because we will always process the
+   * first entry before it. At most 100 entries.
+   * 
+ * + * repeated .google.cloud.speech.v1.TranscriptNormalization.Entry entries = 1; + */ + java.util.List + getEntriesOrBuilderList(); + /** + * + * + *
+   * A list of replacement entries. We will perform replacement with one entry
+   * at a time. For example, the second entry in ["cat" => "dog", "mountain cat"
+   * => "mountain dog"] will never be applied because we will always process the
+   * first entry before it. At most 100 entries.
+   * 
+ * + * repeated .google.cloud.speech.v1.TranscriptNormalization.Entry entries = 1; + */ + com.google.cloud.speech.v1.TranscriptNormalization.EntryOrBuilder getEntriesOrBuilder(int index); +} diff --git a/java-speech/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/WordInfo.java b/java-speech/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/WordInfo.java index 793cebfca048..a595c2b868e6 100644 --- a/java-speech/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/WordInfo.java +++ b/java-speech/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/WordInfo.java @@ -39,6 +39,7 @@ private WordInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { private WordInfo() { word_ = ""; + speakerLabel_ = ""; } @java.lang.Override @@ -268,19 +269,85 @@ public float getConfidence() { * Output only. A distinct integer value is assigned for every speaker within * the audio. This field specifies which one of those speakers was detected to * have spoken this word. Value ranges from '1' to diarization_speaker_count. - * speaker_tag is set if enable_speaker_diarization = 'true' and only in the + * speaker_tag is set if enable_speaker_diarization = 'true' and only for the * top alternative. + * Note: Use speaker_label instead. * * - * int32 speaker_tag = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * int32 speaker_tag = 5 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; + * * + * @deprecated google.cloud.speech.v1.WordInfo.speaker_tag is deprecated. See + * google/cloud/speech/v1/cloud_speech.proto;l=974 * @return The speakerTag. */ @java.lang.Override + @java.lang.Deprecated public int getSpeakerTag() { return speakerTag_; } + public static final int SPEAKER_LABEL_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private volatile java.lang.Object speakerLabel_ = ""; + /** + * + * + *
+   * Output only. A label value assigned for every unique speaker within the
+   * audio. This field specifies which speaker was detected to have spoken this
+   * word. For some models, like medical_conversation this can be actual speaker
+   * role, for example "patient" or "provider", but generally this would be a
+   * number identifying a speaker. This field is only set if
+   * enable_speaker_diarization = 'true' and only for the top alternative.
+   * 
+ * + * string speaker_label = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The speakerLabel. + */ + @java.lang.Override + public java.lang.String getSpeakerLabel() { + java.lang.Object ref = speakerLabel_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + speakerLabel_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. A label value assigned for every unique speaker within the
+   * audio. This field specifies which speaker was detected to have spoken this
+   * word. For some models, like medical_conversation this can be actual speaker
+   * role, for example "patient" or "provider", but generally this would be a
+   * number identifying a speaker. This field is only set if
+   * enable_speaker_diarization = 'true' and only for the top alternative.
+   * 
+ * + * string speaker_label = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for speakerLabel. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSpeakerLabelBytes() { + java.lang.Object ref = speakerLabel_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + speakerLabel_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -310,6 +377,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (speakerTag_ != 0) { output.writeInt32(5, speakerTag_); } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(speakerLabel_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, speakerLabel_); + } getUnknownFields().writeTo(output); } @@ -334,6 +404,9 @@ public int getSerializedSize() { if (speakerTag_ != 0) { size += com.google.protobuf.CodedOutputStream.computeInt32Size(5, speakerTag_); } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(speakerLabel_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, speakerLabel_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -361,6 +434,7 @@ public boolean equals(final java.lang.Object obj) { if (java.lang.Float.floatToIntBits(getConfidence()) != java.lang.Float.floatToIntBits(other.getConfidence())) return false; if (getSpeakerTag() != other.getSpeakerTag()) return false; + if (!getSpeakerLabel().equals(other.getSpeakerLabel())) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -386,6 +460,8 @@ public int hashCode() { hash = (53 * hash) + java.lang.Float.floatToIntBits(getConfidence()); hash = (37 * hash) + SPEAKER_TAG_FIELD_NUMBER; hash = (53 * hash) + getSpeakerTag(); + hash = (37 * hash) + SPEAKER_LABEL_FIELD_NUMBER; + hash = (53 * hash) + getSpeakerLabel().hashCode(); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -537,6 +613,7 @@ public Builder clear() { word_ = ""; confidence_ = 0F; speakerTag_ = 0; + speakerLabel_ = ""; return this; } @@ -587,6 +664,9 @@ private void buildPartial0(com.google.cloud.speech.v1.WordInfo result) { if (((from_bitField0_ & 0x00000010) != 0)) { result.speakerTag_ = speakerTag_; } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.speakerLabel_ = speakerLabel_; + } } @java.lang.Override @@ -651,6 +731,11 @@ public Builder mergeFrom(com.google.cloud.speech.v1.WordInfo other) { if (other.getSpeakerTag() != 0) { setSpeakerTag(other.getSpeakerTag()); } + if (!other.getSpeakerLabel().isEmpty()) { + speakerLabel_ = other.speakerLabel_; + bitField0_ |= 0x00000020; + onChanged(); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -707,6 +792,12 @@ public Builder mergeFrom( bitField0_ |= 0x00000010; break; } // case 40 + case 50: + { + speakerLabel_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 50 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -1359,15 +1450,20 @@ public Builder clearConfidence() { * Output only. A distinct integer value is assigned for every speaker within * the audio. This field specifies which one of those speakers was detected to * have spoken this word. Value ranges from '1' to diarization_speaker_count. - * speaker_tag is set if enable_speaker_diarization = 'true' and only in the + * speaker_tag is set if enable_speaker_diarization = 'true' and only for the * top alternative. + * Note: Use speaker_label instead. * * - * int32 speaker_tag = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * int32 speaker_tag = 5 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; + * * + * @deprecated google.cloud.speech.v1.WordInfo.speaker_tag is deprecated. See + * google/cloud/speech/v1/cloud_speech.proto;l=974 * @return The speakerTag. */ @java.lang.Override + @java.lang.Deprecated public int getSpeakerTag() { return speakerTag_; } @@ -1378,15 +1474,20 @@ public int getSpeakerTag() { * Output only. A distinct integer value is assigned for every speaker within * the audio. This field specifies which one of those speakers was detected to * have spoken this word. Value ranges from '1' to diarization_speaker_count. - * speaker_tag is set if enable_speaker_diarization = 'true' and only in the + * speaker_tag is set if enable_speaker_diarization = 'true' and only for the * top alternative. + * Note: Use speaker_label instead. * * - * int32 speaker_tag = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * int32 speaker_tag = 5 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; + * * + * @deprecated google.cloud.speech.v1.WordInfo.speaker_tag is deprecated. See + * google/cloud/speech/v1/cloud_speech.proto;l=974 * @param value The speakerTag to set. * @return This builder for chaining. */ + @java.lang.Deprecated public Builder setSpeakerTag(int value) { speakerTag_ = value; @@ -1401,14 +1502,19 @@ public Builder setSpeakerTag(int value) { * Output only. A distinct integer value is assigned for every speaker within * the audio. This field specifies which one of those speakers was detected to * have spoken this word. Value ranges from '1' to diarization_speaker_count. - * speaker_tag is set if enable_speaker_diarization = 'true' and only in the + * speaker_tag is set if enable_speaker_diarization = 'true' and only for the * top alternative. + * Note: Use speaker_label instead. * * - * int32 speaker_tag = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * int32 speaker_tag = 5 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; + * * + * @deprecated google.cloud.speech.v1.WordInfo.speaker_tag is deprecated. See + * google/cloud/speech/v1/cloud_speech.proto;l=974 * @return This builder for chaining. */ + @java.lang.Deprecated public Builder clearSpeakerTag() { bitField0_ = (bitField0_ & ~0x00000010); speakerTag_ = 0; @@ -1416,6 +1522,137 @@ public Builder clearSpeakerTag() { return this; } + private java.lang.Object speakerLabel_ = ""; + /** + * + * + *
+     * Output only. A label value assigned for every unique speaker within the
+     * audio. This field specifies which speaker was detected to have spoken this
+     * word. For some models, like medical_conversation this can be actual speaker
+     * role, for example "patient" or "provider", but generally this would be a
+     * number identifying a speaker. This field is only set if
+     * enable_speaker_diarization = 'true' and only for the top alternative.
+     * 
+ * + * string speaker_label = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The speakerLabel. + */ + public java.lang.String getSpeakerLabel() { + java.lang.Object ref = speakerLabel_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + speakerLabel_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. A label value assigned for every unique speaker within the
+     * audio. This field specifies which speaker was detected to have spoken this
+     * word. For some models, like medical_conversation this can be actual speaker
+     * role, for example "patient" or "provider", but generally this would be a
+     * number identifying a speaker. This field is only set if
+     * enable_speaker_diarization = 'true' and only for the top alternative.
+     * 
+ * + * string speaker_label = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for speakerLabel. + */ + public com.google.protobuf.ByteString getSpeakerLabelBytes() { + java.lang.Object ref = speakerLabel_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + speakerLabel_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. A label value assigned for every unique speaker within the
+     * audio. This field specifies which speaker was detected to have spoken this
+     * word. For some models, like medical_conversation this can be actual speaker
+     * role, for example "patient" or "provider", but generally this would be a
+     * number identifying a speaker. This field is only set if
+     * enable_speaker_diarization = 'true' and only for the top alternative.
+     * 
+ * + * string speaker_label = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The speakerLabel to set. + * @return This builder for chaining. + */ + public Builder setSpeakerLabel(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + speakerLabel_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. A label value assigned for every unique speaker within the
+     * audio. This field specifies which speaker was detected to have spoken this
+     * word. For some models, like medical_conversation this can be actual speaker
+     * role, for example "patient" or "provider", but generally this would be a
+     * number identifying a speaker. This field is only set if
+     * enable_speaker_diarization = 'true' and only for the top alternative.
+     * 
+ * + * string speaker_label = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearSpeakerLabel() { + speakerLabel_ = getDefaultInstance().getSpeakerLabel(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. A label value assigned for every unique speaker within the
+     * audio. This field specifies which speaker was detected to have spoken this
+     * word. For some models, like medical_conversation this can be actual speaker
+     * role, for example "patient" or "provider", but generally this would be a
+     * number identifying a speaker. This field is only set if
+     * enable_speaker_diarization = 'true' and only for the top alternative.
+     * 
+ * + * string speaker_label = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for speakerLabel to set. + * @return This builder for chaining. + */ + public Builder setSpeakerLabelBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + speakerLabel_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/java-speech/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/WordInfoOrBuilder.java b/java-speech/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/WordInfoOrBuilder.java index 71f5e896f199..14018c1ebd74 100644 --- a/java-speech/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/WordInfoOrBuilder.java +++ b/java-speech/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/WordInfoOrBuilder.java @@ -174,13 +174,53 @@ public interface WordInfoOrBuilder * Output only. A distinct integer value is assigned for every speaker within * the audio. This field specifies which one of those speakers was detected to * have spoken this word. Value ranges from '1' to diarization_speaker_count. - * speaker_tag is set if enable_speaker_diarization = 'true' and only in the + * speaker_tag is set if enable_speaker_diarization = 'true' and only for the * top alternative. + * Note: Use speaker_label instead. * * - * int32 speaker_tag = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * int32 speaker_tag = 5 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; + * * + * @deprecated google.cloud.speech.v1.WordInfo.speaker_tag is deprecated. See + * google/cloud/speech/v1/cloud_speech.proto;l=974 * @return The speakerTag. */ + @java.lang.Deprecated int getSpeakerTag(); + + /** + * + * + *
+   * Output only. A label value assigned for every unique speaker within the
+   * audio. This field specifies which speaker was detected to have spoken this
+   * word. For some models, like medical_conversation this can be actual speaker
+   * role, for example "patient" or "provider", but generally this would be a
+   * number identifying a speaker. This field is only set if
+   * enable_speaker_diarization = 'true' and only for the top alternative.
+   * 
+ * + * string speaker_label = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The speakerLabel. + */ + java.lang.String getSpeakerLabel(); + /** + * + * + *
+   * Output only. A label value assigned for every unique speaker within the
+   * audio. This field specifies which speaker was detected to have spoken this
+   * word. For some models, like medical_conversation this can be actual speaker
+   * role, for example "patient" or "provider", but generally this would be a
+   * number identifying a speaker. This field is only set if
+   * enable_speaker_diarization = 'true' and only for the top alternative.
+   * 
+ * + * string speaker_label = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for speakerLabel. + */ + com.google.protobuf.ByteString getSpeakerLabelBytes(); } diff --git a/java-speech/proto-google-cloud-speech-v1/src/main/proto/google/cloud/speech/v1/cloud_speech.proto b/java-speech/proto-google-cloud-speech-v1/src/main/proto/google/cloud/speech/v1/cloud_speech.proto index 94cfd6126242..7a74e6a3230e 100644 --- a/java-speech/proto-google-cloud-speech-v1/src/main/proto/google/cloud/speech/v1/cloud_speech.proto +++ b/java-speech/proto-google-cloud-speech-v1/src/main/proto/google/cloud/speech/v1/cloud_speech.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -260,6 +260,12 @@ message RecognitionConfig { // wideband is supported. `sample_rate_hertz` must be 16000. SPEEX_WITH_HEADER_BYTE = 7; + // MP3 audio. MP3 encoding is a Beta feature and only available in + // v1p1beta1. Support all standard MP3 bitrates (which range from 32-320 + // kbps). When using this encoding, `sample_rate_hertz` has to match the + // sample rate of the file being used. + MP3 = 8; + // Opus encoded audio frames in WebM container // ([OggOpus](https://wiki.xiph.org/OggOpus)). `sample_rate_hertz` must be // one of 8000, 12000, 16000, 24000, or 48000. @@ -343,6 +349,13 @@ message RecognitionConfig { // When speech adaptation is set it supersedes the `speech_contexts` field. SpeechAdaptation adaptation = 20; + // Optional. Use transcription normalization to automatically replace parts of + // the transcript with phrases of your choosing. For StreamingRecognize, this + // normalization only applies to stable partial transcripts (stability > 0.8) + // and final transcripts. + TranscriptNormalization transcript_normalization = 24 + [(google.api.field_behavior) = OPTIONAL]; + // Array of [SpeechContext][google.cloud.speech.v1.SpeechContext]. // A means to provide context to assist the speech recognition. For more // information, see @@ -463,8 +476,8 @@ message RecognitionConfig { // Config to enable speaker diarization. message SpeakerDiarizationConfig { // If 'true', enables speaker detection for each recognized word in - // the top alternative of the recognition result using a speaker_tag provided - // in the WordInfo. + // the top alternative of the recognition result using a speaker_label + // provided in the WordInfo. bool enable_speaker_diarization = 1; // Minimum number of speakers in the conversation. This range gives you more @@ -956,9 +969,19 @@ message WordInfo { // Output only. A distinct integer value is assigned for every speaker within // the audio. This field specifies which one of those speakers was detected to // have spoken this word. Value ranges from '1' to diarization_speaker_count. - // speaker_tag is set if enable_speaker_diarization = 'true' and only in the + // speaker_tag is set if enable_speaker_diarization = 'true' and only for the // top alternative. - int32 speaker_tag = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + // Note: Use speaker_label instead. + int32 speaker_tag = 5 + [deprecated = true, (google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A label value assigned for every unique speaker within the + // audio. This field specifies which speaker was detected to have spoken this + // word. For some models, like medical_conversation this can be actual speaker + // role, for example "patient" or "provider", but generally this would be a + // number identifying a speaker. This field is only set if + // enable_speaker_diarization = 'true' and only for the top alternative. + string speaker_label = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; } // Information on speech adaptation use in results diff --git a/java-speech/proto-google-cloud-speech-v1/src/main/proto/google/cloud/speech/v1/resource.proto b/java-speech/proto-google-cloud-speech-v1/src/main/proto/google/cloud/speech/v1/resource.proto index fcfd4640a2ab..d37c11baa88a 100644 --- a/java-speech/proto-google-cloud-speech-v1/src/main/proto/google/cloud/speech/v1/resource.proto +++ b/java-speech/proto-google-cloud-speech-v1/src/main/proto/google/cloud/speech/v1/resource.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -147,3 +147,27 @@ message SpeechAdaptation { // See specifications: https://www.w3.org/TR/speech-grammar ABNFGrammar abnf_grammar = 4; } + +// Transcription normalization configuration. Use transcription normalization +// to automatically replace parts of the transcript with phrases of your +// choosing. For StreamingRecognize, this normalization only applies to stable +// partial transcripts (stability > 0.8) and final transcripts. +message TranscriptNormalization { + // A single replacement configuration. + message Entry { + // What to replace. Max length is 100 characters. + string search = 1; + + // What to replace with. Max length is 100 characters. + string replace = 2; + + // Whether the search is case sensitive. + bool case_sensitive = 3; + } + + // A list of replacement entries. We will perform replacement with one entry + // at a time. For example, the second entry in ["cat" => "dog", "mountain cat" + // => "mountain dog"] will never be applied because we will always process the + // first entry before it. At most 100 entries. + repeated Entry entries = 1; +}