1 /* 2 * Copyright 2020 Google LLC 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * https://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 // Generated by the protocol buffer compiler. DO NOT EDIT! 17 // source: google/cloud/speech/v1/cloud_speech.proto 18 19 package com.google.cloud.speech.v1; 20 21 /** 22 * 23 * 24 * <pre> 25 * Word-specific information for recognized words. 26 * </pre> 27 * 28 * Protobuf type {@code google.cloud.speech.v1.WordInfo} 29 */ 30 public final class WordInfo extends com.google.protobuf.GeneratedMessageV3 31 implements 32 // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.WordInfo) 33 WordInfoOrBuilder { 34 private static final long serialVersionUID = 0L; 35 // Use WordInfo.newBuilder() to construct. WordInfo(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)36 private WordInfo(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { 37 super(builder); 38 } 39 WordInfo()40 private WordInfo() { 41 word_ = ""; 42 } 43 44 @java.lang.Override 45 @SuppressWarnings({"unused"}) newInstance(UnusedPrivateParameter unused)46 protected java.lang.Object newInstance(UnusedPrivateParameter unused) { 47 return new WordInfo(); 48 } 49 50 @java.lang.Override getUnknownFields()51 public final com.google.protobuf.UnknownFieldSet getUnknownFields() { 52 return this.unknownFields; 53 } 54 getDescriptor()55 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 56 return com.google.cloud.speech.v1.SpeechProto 57 .internal_static_google_cloud_speech_v1_WordInfo_descriptor; 58 } 59 60 @java.lang.Override 61 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()62 internalGetFieldAccessorTable() { 63 return com.google.cloud.speech.v1.SpeechProto 64 .internal_static_google_cloud_speech_v1_WordInfo_fieldAccessorTable 65 .ensureFieldAccessorsInitialized( 66 com.google.cloud.speech.v1.WordInfo.class, 67 com.google.cloud.speech.v1.WordInfo.Builder.class); 68 } 69 70 public static final int START_TIME_FIELD_NUMBER = 1; 71 private com.google.protobuf.Duration startTime_; 72 /** 73 * 74 * 75 * <pre> 76 * Time offset relative to the beginning of the audio, 77 * and corresponding to the start of the spoken word. 78 * This field is only set if `enable_word_time_offsets=true` and only 79 * in the top hypothesis. 80 * This is an experimental feature and the accuracy of the time offset can 81 * vary. 82 * </pre> 83 * 84 * <code>.google.protobuf.Duration start_time = 1;</code> 85 * 86 * @return Whether the startTime field is set. 87 */ 88 @java.lang.Override hasStartTime()89 public boolean hasStartTime() { 90 return startTime_ != null; 91 } 92 /** 93 * 94 * 95 * <pre> 96 * Time offset relative to the beginning of the audio, 97 * and corresponding to the start of the spoken word. 98 * This field is only set if `enable_word_time_offsets=true` and only 99 * in the top hypothesis. 100 * This is an experimental feature and the accuracy of the time offset can 101 * vary. 102 * </pre> 103 * 104 * <code>.google.protobuf.Duration start_time = 1;</code> 105 * 106 * @return The startTime. 107 */ 108 @java.lang.Override getStartTime()109 public com.google.protobuf.Duration getStartTime() { 110 return startTime_ == null ? com.google.protobuf.Duration.getDefaultInstance() : startTime_; 111 } 112 /** 113 * 114 * 115 * <pre> 116 * Time offset relative to the beginning of the audio, 117 * and corresponding to the start of the spoken word. 118 * This field is only set if `enable_word_time_offsets=true` and only 119 * in the top hypothesis. 120 * This is an experimental feature and the accuracy of the time offset can 121 * vary. 122 * </pre> 123 * 124 * <code>.google.protobuf.Duration start_time = 1;</code> 125 */ 126 @java.lang.Override getStartTimeOrBuilder()127 public com.google.protobuf.DurationOrBuilder getStartTimeOrBuilder() { 128 return startTime_ == null ? com.google.protobuf.Duration.getDefaultInstance() : startTime_; 129 } 130 131 public static final int END_TIME_FIELD_NUMBER = 2; 132 private com.google.protobuf.Duration endTime_; 133 /** 134 * 135 * 136 * <pre> 137 * Time offset relative to the beginning of the audio, 138 * and corresponding to the end of the spoken word. 139 * This field is only set if `enable_word_time_offsets=true` and only 140 * in the top hypothesis. 141 * This is an experimental feature and the accuracy of the time offset can 142 * vary. 143 * </pre> 144 * 145 * <code>.google.protobuf.Duration end_time = 2;</code> 146 * 147 * @return Whether the endTime field is set. 148 */ 149 @java.lang.Override hasEndTime()150 public boolean hasEndTime() { 151 return endTime_ != null; 152 } 153 /** 154 * 155 * 156 * <pre> 157 * Time offset relative to the beginning of the audio, 158 * and corresponding to the end of the spoken word. 159 * This field is only set if `enable_word_time_offsets=true` and only 160 * in the top hypothesis. 161 * This is an experimental feature and the accuracy of the time offset can 162 * vary. 163 * </pre> 164 * 165 * <code>.google.protobuf.Duration end_time = 2;</code> 166 * 167 * @return The endTime. 168 */ 169 @java.lang.Override getEndTime()170 public com.google.protobuf.Duration getEndTime() { 171 return endTime_ == null ? com.google.protobuf.Duration.getDefaultInstance() : endTime_; 172 } 173 /** 174 * 175 * 176 * <pre> 177 * Time offset relative to the beginning of the audio, 178 * and corresponding to the end of the spoken word. 179 * This field is only set if `enable_word_time_offsets=true` and only 180 * in the top hypothesis. 181 * This is an experimental feature and the accuracy of the time offset can 182 * vary. 183 * </pre> 184 * 185 * <code>.google.protobuf.Duration end_time = 2;</code> 186 */ 187 @java.lang.Override getEndTimeOrBuilder()188 public com.google.protobuf.DurationOrBuilder getEndTimeOrBuilder() { 189 return endTime_ == null ? com.google.protobuf.Duration.getDefaultInstance() : endTime_; 190 } 191 192 public static final int WORD_FIELD_NUMBER = 3; 193 194 @SuppressWarnings("serial") 195 private volatile java.lang.Object word_ = ""; 196 /** 197 * 198 * 199 * <pre> 200 * The word corresponding to this set of information. 201 * </pre> 202 * 203 * <code>string word = 3;</code> 204 * 205 * @return The word. 206 */ 207 @java.lang.Override getWord()208 public java.lang.String getWord() { 209 java.lang.Object ref = word_; 210 if (ref instanceof java.lang.String) { 211 return (java.lang.String) ref; 212 } else { 213 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 214 java.lang.String s = bs.toStringUtf8(); 215 word_ = s; 216 return s; 217 } 218 } 219 /** 220 * 221 * 222 * <pre> 223 * The word corresponding to this set of information. 224 * </pre> 225 * 226 * <code>string word = 3;</code> 227 * 228 * @return The bytes for word. 229 */ 230 @java.lang.Override getWordBytes()231 public com.google.protobuf.ByteString getWordBytes() { 232 java.lang.Object ref = word_; 233 if (ref instanceof java.lang.String) { 234 com.google.protobuf.ByteString b = 235 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 236 word_ = b; 237 return b; 238 } else { 239 return (com.google.protobuf.ByteString) ref; 240 } 241 } 242 243 public static final int CONFIDENCE_FIELD_NUMBER = 4; 244 private float confidence_ = 0F; 245 /** 246 * 247 * 248 * <pre> 249 * The confidence estimate between 0.0 and 1.0. A higher number 250 * indicates an estimated greater likelihood that the recognized words are 251 * correct. This field is set only for the top alternative of a non-streaming 252 * result or, of a streaming result where `is_final=true`. 253 * This field is not guaranteed to be accurate and users should not rely on it 254 * to be always provided. 255 * The default of 0.0 is a sentinel value indicating `confidence` was not set. 256 * </pre> 257 * 258 * <code>float confidence = 4;</code> 259 * 260 * @return The confidence. 261 */ 262 @java.lang.Override getConfidence()263 public float getConfidence() { 264 return confidence_; 265 } 266 267 public static final int SPEAKER_TAG_FIELD_NUMBER = 5; 268 private int speakerTag_ = 0; 269 /** 270 * 271 * 272 * <pre> 273 * Output only. A distinct integer value is assigned for every speaker within 274 * the audio. This field specifies which one of those speakers was detected to 275 * have spoken this word. Value ranges from '1' to diarization_speaker_count. 276 * speaker_tag is set if enable_speaker_diarization = 'true' and only in the 277 * top alternative. 278 * </pre> 279 * 280 * <code>int32 speaker_tag = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code> 281 * 282 * @return The speakerTag. 283 */ 284 @java.lang.Override getSpeakerTag()285 public int getSpeakerTag() { 286 return speakerTag_; 287 } 288 289 private byte memoizedIsInitialized = -1; 290 291 @java.lang.Override isInitialized()292 public final boolean isInitialized() { 293 byte isInitialized = memoizedIsInitialized; 294 if (isInitialized == 1) return true; 295 if (isInitialized == 0) return false; 296 297 memoizedIsInitialized = 1; 298 return true; 299 } 300 301 @java.lang.Override writeTo(com.google.protobuf.CodedOutputStream output)302 public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { 303 if (startTime_ != null) { 304 output.writeMessage(1, getStartTime()); 305 } 306 if (endTime_ != null) { 307 output.writeMessage(2, getEndTime()); 308 } 309 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(word_)) { 310 com.google.protobuf.GeneratedMessageV3.writeString(output, 3, word_); 311 } 312 if (java.lang.Float.floatToRawIntBits(confidence_) != 0) { 313 output.writeFloat(4, confidence_); 314 } 315 if (speakerTag_ != 0) { 316 output.writeInt32(5, speakerTag_); 317 } 318 getUnknownFields().writeTo(output); 319 } 320 321 @java.lang.Override getSerializedSize()322 public int getSerializedSize() { 323 int size = memoizedSize; 324 if (size != -1) return size; 325 326 size = 0; 327 if (startTime_ != null) { 328 size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getStartTime()); 329 } 330 if (endTime_ != null) { 331 size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getEndTime()); 332 } 333 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(word_)) { 334 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, word_); 335 } 336 if (java.lang.Float.floatToRawIntBits(confidence_) != 0) { 337 size += com.google.protobuf.CodedOutputStream.computeFloatSize(4, confidence_); 338 } 339 if (speakerTag_ != 0) { 340 size += com.google.protobuf.CodedOutputStream.computeInt32Size(5, speakerTag_); 341 } 342 size += getUnknownFields().getSerializedSize(); 343 memoizedSize = size; 344 return size; 345 } 346 347 @java.lang.Override equals(final java.lang.Object obj)348 public boolean equals(final java.lang.Object obj) { 349 if (obj == this) { 350 return true; 351 } 352 if (!(obj instanceof com.google.cloud.speech.v1.WordInfo)) { 353 return super.equals(obj); 354 } 355 com.google.cloud.speech.v1.WordInfo other = (com.google.cloud.speech.v1.WordInfo) obj; 356 357 if (hasStartTime() != other.hasStartTime()) return false; 358 if (hasStartTime()) { 359 if (!getStartTime().equals(other.getStartTime())) return false; 360 } 361 if (hasEndTime() != other.hasEndTime()) return false; 362 if (hasEndTime()) { 363 if (!getEndTime().equals(other.getEndTime())) return false; 364 } 365 if (!getWord().equals(other.getWord())) return false; 366 if (java.lang.Float.floatToIntBits(getConfidence()) 367 != java.lang.Float.floatToIntBits(other.getConfidence())) return false; 368 if (getSpeakerTag() != other.getSpeakerTag()) return false; 369 if (!getUnknownFields().equals(other.getUnknownFields())) return false; 370 return true; 371 } 372 373 @java.lang.Override hashCode()374 public int hashCode() { 375 if (memoizedHashCode != 0) { 376 return memoizedHashCode; 377 } 378 int hash = 41; 379 hash = (19 * hash) + getDescriptor().hashCode(); 380 if (hasStartTime()) { 381 hash = (37 * hash) + START_TIME_FIELD_NUMBER; 382 hash = (53 * hash) + getStartTime().hashCode(); 383 } 384 if (hasEndTime()) { 385 hash = (37 * hash) + END_TIME_FIELD_NUMBER; 386 hash = (53 * hash) + getEndTime().hashCode(); 387 } 388 hash = (37 * hash) + WORD_FIELD_NUMBER; 389 hash = (53 * hash) + getWord().hashCode(); 390 hash = (37 * hash) + CONFIDENCE_FIELD_NUMBER; 391 hash = (53 * hash) + java.lang.Float.floatToIntBits(getConfidence()); 392 hash = (37 * hash) + SPEAKER_TAG_FIELD_NUMBER; 393 hash = (53 * hash) + getSpeakerTag(); 394 hash = (29 * hash) + getUnknownFields().hashCode(); 395 memoizedHashCode = hash; 396 return hash; 397 } 398 parseFrom(java.nio.ByteBuffer data)399 public static com.google.cloud.speech.v1.WordInfo parseFrom(java.nio.ByteBuffer data) 400 throws com.google.protobuf.InvalidProtocolBufferException { 401 return PARSER.parseFrom(data); 402 } 403 parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)404 public static com.google.cloud.speech.v1.WordInfo parseFrom( 405 java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 406 throws com.google.protobuf.InvalidProtocolBufferException { 407 return PARSER.parseFrom(data, extensionRegistry); 408 } 409 parseFrom(com.google.protobuf.ByteString data)410 public static com.google.cloud.speech.v1.WordInfo parseFrom(com.google.protobuf.ByteString data) 411 throws com.google.protobuf.InvalidProtocolBufferException { 412 return PARSER.parseFrom(data); 413 } 414 parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)415 public static com.google.cloud.speech.v1.WordInfo parseFrom( 416 com.google.protobuf.ByteString data, 417 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 418 throws com.google.protobuf.InvalidProtocolBufferException { 419 return PARSER.parseFrom(data, extensionRegistry); 420 } 421 parseFrom(byte[] data)422 public static com.google.cloud.speech.v1.WordInfo parseFrom(byte[] data) 423 throws com.google.protobuf.InvalidProtocolBufferException { 424 return PARSER.parseFrom(data); 425 } 426 parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)427 public static com.google.cloud.speech.v1.WordInfo parseFrom( 428 byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 429 throws com.google.protobuf.InvalidProtocolBufferException { 430 return PARSER.parseFrom(data, extensionRegistry); 431 } 432 parseFrom(java.io.InputStream input)433 public static com.google.cloud.speech.v1.WordInfo parseFrom(java.io.InputStream input) 434 throws java.io.IOException { 435 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 436 } 437 parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)438 public static com.google.cloud.speech.v1.WordInfo parseFrom( 439 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 440 throws java.io.IOException { 441 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 442 PARSER, input, extensionRegistry); 443 } 444 parseDelimitedFrom(java.io.InputStream input)445 public static com.google.cloud.speech.v1.WordInfo parseDelimitedFrom(java.io.InputStream input) 446 throws java.io.IOException { 447 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); 448 } 449 parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)450 public static com.google.cloud.speech.v1.WordInfo parseDelimitedFrom( 451 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 452 throws java.io.IOException { 453 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( 454 PARSER, input, extensionRegistry); 455 } 456 parseFrom( com.google.protobuf.CodedInputStream input)457 public static com.google.cloud.speech.v1.WordInfo parseFrom( 458 com.google.protobuf.CodedInputStream input) throws java.io.IOException { 459 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 460 } 461 parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)462 public static com.google.cloud.speech.v1.WordInfo parseFrom( 463 com.google.protobuf.CodedInputStream input, 464 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 465 throws java.io.IOException { 466 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 467 PARSER, input, extensionRegistry); 468 } 469 470 @java.lang.Override newBuilderForType()471 public Builder newBuilderForType() { 472 return newBuilder(); 473 } 474 newBuilder()475 public static Builder newBuilder() { 476 return DEFAULT_INSTANCE.toBuilder(); 477 } 478 newBuilder(com.google.cloud.speech.v1.WordInfo prototype)479 public static Builder newBuilder(com.google.cloud.speech.v1.WordInfo prototype) { 480 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); 481 } 482 483 @java.lang.Override toBuilder()484 public Builder toBuilder() { 485 return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); 486 } 487 488 @java.lang.Override newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)489 protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 490 Builder builder = new Builder(parent); 491 return builder; 492 } 493 /** 494 * 495 * 496 * <pre> 497 * Word-specific information for recognized words. 498 * </pre> 499 * 500 * Protobuf type {@code google.cloud.speech.v1.WordInfo} 501 */ 502 public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> 503 implements 504 // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1.WordInfo) 505 com.google.cloud.speech.v1.WordInfoOrBuilder { getDescriptor()506 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 507 return com.google.cloud.speech.v1.SpeechProto 508 .internal_static_google_cloud_speech_v1_WordInfo_descriptor; 509 } 510 511 @java.lang.Override 512 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()513 internalGetFieldAccessorTable() { 514 return com.google.cloud.speech.v1.SpeechProto 515 .internal_static_google_cloud_speech_v1_WordInfo_fieldAccessorTable 516 .ensureFieldAccessorsInitialized( 517 com.google.cloud.speech.v1.WordInfo.class, 518 com.google.cloud.speech.v1.WordInfo.Builder.class); 519 } 520 521 // Construct using com.google.cloud.speech.v1.WordInfo.newBuilder() Builder()522 private Builder() {} 523 Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)524 private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 525 super(parent); 526 } 527 528 @java.lang.Override clear()529 public Builder clear() { 530 super.clear(); 531 bitField0_ = 0; 532 startTime_ = null; 533 if (startTimeBuilder_ != null) { 534 startTimeBuilder_.dispose(); 535 startTimeBuilder_ = null; 536 } 537 endTime_ = null; 538 if (endTimeBuilder_ != null) { 539 endTimeBuilder_.dispose(); 540 endTimeBuilder_ = null; 541 } 542 word_ = ""; 543 confidence_ = 0F; 544 speakerTag_ = 0; 545 return this; 546 } 547 548 @java.lang.Override getDescriptorForType()549 public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { 550 return com.google.cloud.speech.v1.SpeechProto 551 .internal_static_google_cloud_speech_v1_WordInfo_descriptor; 552 } 553 554 @java.lang.Override getDefaultInstanceForType()555 public com.google.cloud.speech.v1.WordInfo getDefaultInstanceForType() { 556 return com.google.cloud.speech.v1.WordInfo.getDefaultInstance(); 557 } 558 559 @java.lang.Override build()560 public com.google.cloud.speech.v1.WordInfo build() { 561 com.google.cloud.speech.v1.WordInfo result = buildPartial(); 562 if (!result.isInitialized()) { 563 throw newUninitializedMessageException(result); 564 } 565 return result; 566 } 567 568 @java.lang.Override buildPartial()569 public com.google.cloud.speech.v1.WordInfo buildPartial() { 570 com.google.cloud.speech.v1.WordInfo result = new com.google.cloud.speech.v1.WordInfo(this); 571 if (bitField0_ != 0) { 572 buildPartial0(result); 573 } 574 onBuilt(); 575 return result; 576 } 577 buildPartial0(com.google.cloud.speech.v1.WordInfo result)578 private void buildPartial0(com.google.cloud.speech.v1.WordInfo result) { 579 int from_bitField0_ = bitField0_; 580 if (((from_bitField0_ & 0x00000001) != 0)) { 581 result.startTime_ = startTimeBuilder_ == null ? startTime_ : startTimeBuilder_.build(); 582 } 583 if (((from_bitField0_ & 0x00000002) != 0)) { 584 result.endTime_ = endTimeBuilder_ == null ? endTime_ : endTimeBuilder_.build(); 585 } 586 if (((from_bitField0_ & 0x00000004) != 0)) { 587 result.word_ = word_; 588 } 589 if (((from_bitField0_ & 0x00000008) != 0)) { 590 result.confidence_ = confidence_; 591 } 592 if (((from_bitField0_ & 0x00000010) != 0)) { 593 result.speakerTag_ = speakerTag_; 594 } 595 } 596 597 @java.lang.Override clone()598 public Builder clone() { 599 return super.clone(); 600 } 601 602 @java.lang.Override setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)603 public Builder setField( 604 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 605 return super.setField(field, value); 606 } 607 608 @java.lang.Override clearField(com.google.protobuf.Descriptors.FieldDescriptor field)609 public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { 610 return super.clearField(field); 611 } 612 613 @java.lang.Override clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)614 public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { 615 return super.clearOneof(oneof); 616 } 617 618 @java.lang.Override setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)619 public Builder setRepeatedField( 620 com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { 621 return super.setRepeatedField(field, index, value); 622 } 623 624 @java.lang.Override addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)625 public Builder addRepeatedField( 626 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 627 return super.addRepeatedField(field, value); 628 } 629 630 @java.lang.Override mergeFrom(com.google.protobuf.Message other)631 public Builder mergeFrom(com.google.protobuf.Message other) { 632 if (other instanceof com.google.cloud.speech.v1.WordInfo) { 633 return mergeFrom((com.google.cloud.speech.v1.WordInfo) other); 634 } else { 635 super.mergeFrom(other); 636 return this; 637 } 638 } 639 mergeFrom(com.google.cloud.speech.v1.WordInfo other)640 public Builder mergeFrom(com.google.cloud.speech.v1.WordInfo other) { 641 if (other == com.google.cloud.speech.v1.WordInfo.getDefaultInstance()) return this; 642 if (other.hasStartTime()) { 643 mergeStartTime(other.getStartTime()); 644 } 645 if (other.hasEndTime()) { 646 mergeEndTime(other.getEndTime()); 647 } 648 if (!other.getWord().isEmpty()) { 649 word_ = other.word_; 650 bitField0_ |= 0x00000004; 651 onChanged(); 652 } 653 if (other.getConfidence() != 0F) { 654 setConfidence(other.getConfidence()); 655 } 656 if (other.getSpeakerTag() != 0) { 657 setSpeakerTag(other.getSpeakerTag()); 658 } 659 this.mergeUnknownFields(other.getUnknownFields()); 660 onChanged(); 661 return this; 662 } 663 664 @java.lang.Override isInitialized()665 public final boolean isInitialized() { 666 return true; 667 } 668 669 @java.lang.Override mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)670 public Builder mergeFrom( 671 com.google.protobuf.CodedInputStream input, 672 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 673 throws java.io.IOException { 674 if (extensionRegistry == null) { 675 throw new java.lang.NullPointerException(); 676 } 677 try { 678 boolean done = false; 679 while (!done) { 680 int tag = input.readTag(); 681 switch (tag) { 682 case 0: 683 done = true; 684 break; 685 case 10: 686 { 687 input.readMessage(getStartTimeFieldBuilder().getBuilder(), extensionRegistry); 688 bitField0_ |= 0x00000001; 689 break; 690 } // case 10 691 case 18: 692 { 693 input.readMessage(getEndTimeFieldBuilder().getBuilder(), extensionRegistry); 694 bitField0_ |= 0x00000002; 695 break; 696 } // case 18 697 case 26: 698 { 699 word_ = input.readStringRequireUtf8(); 700 bitField0_ |= 0x00000004; 701 break; 702 } // case 26 703 case 37: 704 { 705 confidence_ = input.readFloat(); 706 bitField0_ |= 0x00000008; 707 break; 708 } // case 37 709 case 40: 710 { 711 speakerTag_ = input.readInt32(); 712 bitField0_ |= 0x00000010; 713 break; 714 } // case 40 715 default: 716 { 717 if (!super.parseUnknownField(input, extensionRegistry, tag)) { 718 done = true; // was an endgroup tag 719 } 720 break; 721 } // default: 722 } // switch (tag) 723 } // while (!done) 724 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 725 throw e.unwrapIOException(); 726 } finally { 727 onChanged(); 728 } // finally 729 return this; 730 } 731 732 private int bitField0_; 733 734 private com.google.protobuf.Duration startTime_; 735 private com.google.protobuf.SingleFieldBuilderV3< 736 com.google.protobuf.Duration, 737 com.google.protobuf.Duration.Builder, 738 com.google.protobuf.DurationOrBuilder> 739 startTimeBuilder_; 740 /** 741 * 742 * 743 * <pre> 744 * Time offset relative to the beginning of the audio, 745 * and corresponding to the start of the spoken word. 746 * This field is only set if `enable_word_time_offsets=true` and only 747 * in the top hypothesis. 748 * This is an experimental feature and the accuracy of the time offset can 749 * vary. 750 * </pre> 751 * 752 * <code>.google.protobuf.Duration start_time = 1;</code> 753 * 754 * @return Whether the startTime field is set. 755 */ hasStartTime()756 public boolean hasStartTime() { 757 return ((bitField0_ & 0x00000001) != 0); 758 } 759 /** 760 * 761 * 762 * <pre> 763 * Time offset relative to the beginning of the audio, 764 * and corresponding to the start of the spoken word. 765 * This field is only set if `enable_word_time_offsets=true` and only 766 * in the top hypothesis. 767 * This is an experimental feature and the accuracy of the time offset can 768 * vary. 769 * </pre> 770 * 771 * <code>.google.protobuf.Duration start_time = 1;</code> 772 * 773 * @return The startTime. 774 */ getStartTime()775 public com.google.protobuf.Duration getStartTime() { 776 if (startTimeBuilder_ == null) { 777 return startTime_ == null ? com.google.protobuf.Duration.getDefaultInstance() : startTime_; 778 } else { 779 return startTimeBuilder_.getMessage(); 780 } 781 } 782 /** 783 * 784 * 785 * <pre> 786 * Time offset relative to the beginning of the audio, 787 * and corresponding to the start of the spoken word. 788 * This field is only set if `enable_word_time_offsets=true` and only 789 * in the top hypothesis. 790 * This is an experimental feature and the accuracy of the time offset can 791 * vary. 792 * </pre> 793 * 794 * <code>.google.protobuf.Duration start_time = 1;</code> 795 */ setStartTime(com.google.protobuf.Duration value)796 public Builder setStartTime(com.google.protobuf.Duration value) { 797 if (startTimeBuilder_ == null) { 798 if (value == null) { 799 throw new NullPointerException(); 800 } 801 startTime_ = value; 802 } else { 803 startTimeBuilder_.setMessage(value); 804 } 805 bitField0_ |= 0x00000001; 806 onChanged(); 807 return this; 808 } 809 /** 810 * 811 * 812 * <pre> 813 * Time offset relative to the beginning of the audio, 814 * and corresponding to the start of the spoken word. 815 * This field is only set if `enable_word_time_offsets=true` and only 816 * in the top hypothesis. 817 * This is an experimental feature and the accuracy of the time offset can 818 * vary. 819 * </pre> 820 * 821 * <code>.google.protobuf.Duration start_time = 1;</code> 822 */ setStartTime(com.google.protobuf.Duration.Builder builderForValue)823 public Builder setStartTime(com.google.protobuf.Duration.Builder builderForValue) { 824 if (startTimeBuilder_ == null) { 825 startTime_ = builderForValue.build(); 826 } else { 827 startTimeBuilder_.setMessage(builderForValue.build()); 828 } 829 bitField0_ |= 0x00000001; 830 onChanged(); 831 return this; 832 } 833 /** 834 * 835 * 836 * <pre> 837 * Time offset relative to the beginning of the audio, 838 * and corresponding to the start of the spoken word. 839 * This field is only set if `enable_word_time_offsets=true` and only 840 * in the top hypothesis. 841 * This is an experimental feature and the accuracy of the time offset can 842 * vary. 843 * </pre> 844 * 845 * <code>.google.protobuf.Duration start_time = 1;</code> 846 */ mergeStartTime(com.google.protobuf.Duration value)847 public Builder mergeStartTime(com.google.protobuf.Duration value) { 848 if (startTimeBuilder_ == null) { 849 if (((bitField0_ & 0x00000001) != 0) 850 && startTime_ != null 851 && startTime_ != com.google.protobuf.Duration.getDefaultInstance()) { 852 getStartTimeBuilder().mergeFrom(value); 853 } else { 854 startTime_ = value; 855 } 856 } else { 857 startTimeBuilder_.mergeFrom(value); 858 } 859 bitField0_ |= 0x00000001; 860 onChanged(); 861 return this; 862 } 863 /** 864 * 865 * 866 * <pre> 867 * Time offset relative to the beginning of the audio, 868 * and corresponding to the start of the spoken word. 869 * This field is only set if `enable_word_time_offsets=true` and only 870 * in the top hypothesis. 871 * This is an experimental feature and the accuracy of the time offset can 872 * vary. 873 * </pre> 874 * 875 * <code>.google.protobuf.Duration start_time = 1;</code> 876 */ clearStartTime()877 public Builder clearStartTime() { 878 bitField0_ = (bitField0_ & ~0x00000001); 879 startTime_ = null; 880 if (startTimeBuilder_ != null) { 881 startTimeBuilder_.dispose(); 882 startTimeBuilder_ = null; 883 } 884 onChanged(); 885 return this; 886 } 887 /** 888 * 889 * 890 * <pre> 891 * Time offset relative to the beginning of the audio, 892 * and corresponding to the start of the spoken word. 893 * This field is only set if `enable_word_time_offsets=true` and only 894 * in the top hypothesis. 895 * This is an experimental feature and the accuracy of the time offset can 896 * vary. 897 * </pre> 898 * 899 * <code>.google.protobuf.Duration start_time = 1;</code> 900 */ getStartTimeBuilder()901 public com.google.protobuf.Duration.Builder getStartTimeBuilder() { 902 bitField0_ |= 0x00000001; 903 onChanged(); 904 return getStartTimeFieldBuilder().getBuilder(); 905 } 906 /** 907 * 908 * 909 * <pre> 910 * Time offset relative to the beginning of the audio, 911 * and corresponding to the start of the spoken word. 912 * This field is only set if `enable_word_time_offsets=true` and only 913 * in the top hypothesis. 914 * This is an experimental feature and the accuracy of the time offset can 915 * vary. 916 * </pre> 917 * 918 * <code>.google.protobuf.Duration start_time = 1;</code> 919 */ getStartTimeOrBuilder()920 public com.google.protobuf.DurationOrBuilder getStartTimeOrBuilder() { 921 if (startTimeBuilder_ != null) { 922 return startTimeBuilder_.getMessageOrBuilder(); 923 } else { 924 return startTime_ == null ? com.google.protobuf.Duration.getDefaultInstance() : startTime_; 925 } 926 } 927 /** 928 * 929 * 930 * <pre> 931 * Time offset relative to the beginning of the audio, 932 * and corresponding to the start of the spoken word. 933 * This field is only set if `enable_word_time_offsets=true` and only 934 * in the top hypothesis. 935 * This is an experimental feature and the accuracy of the time offset can 936 * vary. 937 * </pre> 938 * 939 * <code>.google.protobuf.Duration start_time = 1;</code> 940 */ 941 private com.google.protobuf.SingleFieldBuilderV3< 942 com.google.protobuf.Duration, 943 com.google.protobuf.Duration.Builder, 944 com.google.protobuf.DurationOrBuilder> getStartTimeFieldBuilder()945 getStartTimeFieldBuilder() { 946 if (startTimeBuilder_ == null) { 947 startTimeBuilder_ = 948 new com.google.protobuf.SingleFieldBuilderV3< 949 com.google.protobuf.Duration, 950 com.google.protobuf.Duration.Builder, 951 com.google.protobuf.DurationOrBuilder>( 952 getStartTime(), getParentForChildren(), isClean()); 953 startTime_ = null; 954 } 955 return startTimeBuilder_; 956 } 957 958 private com.google.protobuf.Duration endTime_; 959 private com.google.protobuf.SingleFieldBuilderV3< 960 com.google.protobuf.Duration, 961 com.google.protobuf.Duration.Builder, 962 com.google.protobuf.DurationOrBuilder> 963 endTimeBuilder_; 964 /** 965 * 966 * 967 * <pre> 968 * Time offset relative to the beginning of the audio, 969 * and corresponding to the end of the spoken word. 970 * This field is only set if `enable_word_time_offsets=true` and only 971 * in the top hypothesis. 972 * This is an experimental feature and the accuracy of the time offset can 973 * vary. 974 * </pre> 975 * 976 * <code>.google.protobuf.Duration end_time = 2;</code> 977 * 978 * @return Whether the endTime field is set. 979 */ hasEndTime()980 public boolean hasEndTime() { 981 return ((bitField0_ & 0x00000002) != 0); 982 } 983 /** 984 * 985 * 986 * <pre> 987 * Time offset relative to the beginning of the audio, 988 * and corresponding to the end of the spoken word. 989 * This field is only set if `enable_word_time_offsets=true` and only 990 * in the top hypothesis. 991 * This is an experimental feature and the accuracy of the time offset can 992 * vary. 993 * </pre> 994 * 995 * <code>.google.protobuf.Duration end_time = 2;</code> 996 * 997 * @return The endTime. 998 */ getEndTime()999 public com.google.protobuf.Duration getEndTime() { 1000 if (endTimeBuilder_ == null) { 1001 return endTime_ == null ? com.google.protobuf.Duration.getDefaultInstance() : endTime_; 1002 } else { 1003 return endTimeBuilder_.getMessage(); 1004 } 1005 } 1006 /** 1007 * 1008 * 1009 * <pre> 1010 * Time offset relative to the beginning of the audio, 1011 * and corresponding to the end of the spoken word. 1012 * This field is only set if `enable_word_time_offsets=true` and only 1013 * in the top hypothesis. 1014 * This is an experimental feature and the accuracy of the time offset can 1015 * vary. 1016 * </pre> 1017 * 1018 * <code>.google.protobuf.Duration end_time = 2;</code> 1019 */ setEndTime(com.google.protobuf.Duration value)1020 public Builder setEndTime(com.google.protobuf.Duration value) { 1021 if (endTimeBuilder_ == null) { 1022 if (value == null) { 1023 throw new NullPointerException(); 1024 } 1025 endTime_ = value; 1026 } else { 1027 endTimeBuilder_.setMessage(value); 1028 } 1029 bitField0_ |= 0x00000002; 1030 onChanged(); 1031 return this; 1032 } 1033 /** 1034 * 1035 * 1036 * <pre> 1037 * Time offset relative to the beginning of the audio, 1038 * and corresponding to the end of the spoken word. 1039 * This field is only set if `enable_word_time_offsets=true` and only 1040 * in the top hypothesis. 1041 * This is an experimental feature and the accuracy of the time offset can 1042 * vary. 1043 * </pre> 1044 * 1045 * <code>.google.protobuf.Duration end_time = 2;</code> 1046 */ setEndTime(com.google.protobuf.Duration.Builder builderForValue)1047 public Builder setEndTime(com.google.protobuf.Duration.Builder builderForValue) { 1048 if (endTimeBuilder_ == null) { 1049 endTime_ = builderForValue.build(); 1050 } else { 1051 endTimeBuilder_.setMessage(builderForValue.build()); 1052 } 1053 bitField0_ |= 0x00000002; 1054 onChanged(); 1055 return this; 1056 } 1057 /** 1058 * 1059 * 1060 * <pre> 1061 * Time offset relative to the beginning of the audio, 1062 * and corresponding to the end of the spoken word. 1063 * This field is only set if `enable_word_time_offsets=true` and only 1064 * in the top hypothesis. 1065 * This is an experimental feature and the accuracy of the time offset can 1066 * vary. 1067 * </pre> 1068 * 1069 * <code>.google.protobuf.Duration end_time = 2;</code> 1070 */ mergeEndTime(com.google.protobuf.Duration value)1071 public Builder mergeEndTime(com.google.protobuf.Duration value) { 1072 if (endTimeBuilder_ == null) { 1073 if (((bitField0_ & 0x00000002) != 0) 1074 && endTime_ != null 1075 && endTime_ != com.google.protobuf.Duration.getDefaultInstance()) { 1076 getEndTimeBuilder().mergeFrom(value); 1077 } else { 1078 endTime_ = value; 1079 } 1080 } else { 1081 endTimeBuilder_.mergeFrom(value); 1082 } 1083 bitField0_ |= 0x00000002; 1084 onChanged(); 1085 return this; 1086 } 1087 /** 1088 * 1089 * 1090 * <pre> 1091 * Time offset relative to the beginning of the audio, 1092 * and corresponding to the end of the spoken word. 1093 * This field is only set if `enable_word_time_offsets=true` and only 1094 * in the top hypothesis. 1095 * This is an experimental feature and the accuracy of the time offset can 1096 * vary. 1097 * </pre> 1098 * 1099 * <code>.google.protobuf.Duration end_time = 2;</code> 1100 */ clearEndTime()1101 public Builder clearEndTime() { 1102 bitField0_ = (bitField0_ & ~0x00000002); 1103 endTime_ = null; 1104 if (endTimeBuilder_ != null) { 1105 endTimeBuilder_.dispose(); 1106 endTimeBuilder_ = null; 1107 } 1108 onChanged(); 1109 return this; 1110 } 1111 /** 1112 * 1113 * 1114 * <pre> 1115 * Time offset relative to the beginning of the audio, 1116 * and corresponding to the end of the spoken word. 1117 * This field is only set if `enable_word_time_offsets=true` and only 1118 * in the top hypothesis. 1119 * This is an experimental feature and the accuracy of the time offset can 1120 * vary. 1121 * </pre> 1122 * 1123 * <code>.google.protobuf.Duration end_time = 2;</code> 1124 */ getEndTimeBuilder()1125 public com.google.protobuf.Duration.Builder getEndTimeBuilder() { 1126 bitField0_ |= 0x00000002; 1127 onChanged(); 1128 return getEndTimeFieldBuilder().getBuilder(); 1129 } 1130 /** 1131 * 1132 * 1133 * <pre> 1134 * Time offset relative to the beginning of the audio, 1135 * and corresponding to the end of the spoken word. 1136 * This field is only set if `enable_word_time_offsets=true` and only 1137 * in the top hypothesis. 1138 * This is an experimental feature and the accuracy of the time offset can 1139 * vary. 1140 * </pre> 1141 * 1142 * <code>.google.protobuf.Duration end_time = 2;</code> 1143 */ getEndTimeOrBuilder()1144 public com.google.protobuf.DurationOrBuilder getEndTimeOrBuilder() { 1145 if (endTimeBuilder_ != null) { 1146 return endTimeBuilder_.getMessageOrBuilder(); 1147 } else { 1148 return endTime_ == null ? com.google.protobuf.Duration.getDefaultInstance() : endTime_; 1149 } 1150 } 1151 /** 1152 * 1153 * 1154 * <pre> 1155 * Time offset relative to the beginning of the audio, 1156 * and corresponding to the end of the spoken word. 1157 * This field is only set if `enable_word_time_offsets=true` and only 1158 * in the top hypothesis. 1159 * This is an experimental feature and the accuracy of the time offset can 1160 * vary. 1161 * </pre> 1162 * 1163 * <code>.google.protobuf.Duration end_time = 2;</code> 1164 */ 1165 private com.google.protobuf.SingleFieldBuilderV3< 1166 com.google.protobuf.Duration, 1167 com.google.protobuf.Duration.Builder, 1168 com.google.protobuf.DurationOrBuilder> getEndTimeFieldBuilder()1169 getEndTimeFieldBuilder() { 1170 if (endTimeBuilder_ == null) { 1171 endTimeBuilder_ = 1172 new com.google.protobuf.SingleFieldBuilderV3< 1173 com.google.protobuf.Duration, 1174 com.google.protobuf.Duration.Builder, 1175 com.google.protobuf.DurationOrBuilder>( 1176 getEndTime(), getParentForChildren(), isClean()); 1177 endTime_ = null; 1178 } 1179 return endTimeBuilder_; 1180 } 1181 1182 private java.lang.Object word_ = ""; 1183 /** 1184 * 1185 * 1186 * <pre> 1187 * The word corresponding to this set of information. 1188 * </pre> 1189 * 1190 * <code>string word = 3;</code> 1191 * 1192 * @return The word. 1193 */ getWord()1194 public java.lang.String getWord() { 1195 java.lang.Object ref = word_; 1196 if (!(ref instanceof java.lang.String)) { 1197 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 1198 java.lang.String s = bs.toStringUtf8(); 1199 word_ = s; 1200 return s; 1201 } else { 1202 return (java.lang.String) ref; 1203 } 1204 } 1205 /** 1206 * 1207 * 1208 * <pre> 1209 * The word corresponding to this set of information. 1210 * </pre> 1211 * 1212 * <code>string word = 3;</code> 1213 * 1214 * @return The bytes for word. 1215 */ getWordBytes()1216 public com.google.protobuf.ByteString getWordBytes() { 1217 java.lang.Object ref = word_; 1218 if (ref instanceof String) { 1219 com.google.protobuf.ByteString b = 1220 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 1221 word_ = b; 1222 return b; 1223 } else { 1224 return (com.google.protobuf.ByteString) ref; 1225 } 1226 } 1227 /** 1228 * 1229 * 1230 * <pre> 1231 * The word corresponding to this set of information. 1232 * </pre> 1233 * 1234 * <code>string word = 3;</code> 1235 * 1236 * @param value The word to set. 1237 * @return This builder for chaining. 1238 */ setWord(java.lang.String value)1239 public Builder setWord(java.lang.String value) { 1240 if (value == null) { 1241 throw new NullPointerException(); 1242 } 1243 word_ = value; 1244 bitField0_ |= 0x00000004; 1245 onChanged(); 1246 return this; 1247 } 1248 /** 1249 * 1250 * 1251 * <pre> 1252 * The word corresponding to this set of information. 1253 * </pre> 1254 * 1255 * <code>string word = 3;</code> 1256 * 1257 * @return This builder for chaining. 1258 */ clearWord()1259 public Builder clearWord() { 1260 word_ = getDefaultInstance().getWord(); 1261 bitField0_ = (bitField0_ & ~0x00000004); 1262 onChanged(); 1263 return this; 1264 } 1265 /** 1266 * 1267 * 1268 * <pre> 1269 * The word corresponding to this set of information. 1270 * </pre> 1271 * 1272 * <code>string word = 3;</code> 1273 * 1274 * @param value The bytes for word to set. 1275 * @return This builder for chaining. 1276 */ setWordBytes(com.google.protobuf.ByteString value)1277 public Builder setWordBytes(com.google.protobuf.ByteString value) { 1278 if (value == null) { 1279 throw new NullPointerException(); 1280 } 1281 checkByteStringIsUtf8(value); 1282 word_ = value; 1283 bitField0_ |= 0x00000004; 1284 onChanged(); 1285 return this; 1286 } 1287 1288 private float confidence_; 1289 /** 1290 * 1291 * 1292 * <pre> 1293 * The confidence estimate between 0.0 and 1.0. A higher number 1294 * indicates an estimated greater likelihood that the recognized words are 1295 * correct. This field is set only for the top alternative of a non-streaming 1296 * result or, of a streaming result where `is_final=true`. 1297 * This field is not guaranteed to be accurate and users should not rely on it 1298 * to be always provided. 1299 * The default of 0.0 is a sentinel value indicating `confidence` was not set. 1300 * </pre> 1301 * 1302 * <code>float confidence = 4;</code> 1303 * 1304 * @return The confidence. 1305 */ 1306 @java.lang.Override getConfidence()1307 public float getConfidence() { 1308 return confidence_; 1309 } 1310 /** 1311 * 1312 * 1313 * <pre> 1314 * The confidence estimate between 0.0 and 1.0. A higher number 1315 * indicates an estimated greater likelihood that the recognized words are 1316 * correct. This field is set only for the top alternative of a non-streaming 1317 * result or, of a streaming result where `is_final=true`. 1318 * This field is not guaranteed to be accurate and users should not rely on it 1319 * to be always provided. 1320 * The default of 0.0 is a sentinel value indicating `confidence` was not set. 1321 * </pre> 1322 * 1323 * <code>float confidence = 4;</code> 1324 * 1325 * @param value The confidence to set. 1326 * @return This builder for chaining. 1327 */ setConfidence(float value)1328 public Builder setConfidence(float value) { 1329 1330 confidence_ = value; 1331 bitField0_ |= 0x00000008; 1332 onChanged(); 1333 return this; 1334 } 1335 /** 1336 * 1337 * 1338 * <pre> 1339 * The confidence estimate between 0.0 and 1.0. A higher number 1340 * indicates an estimated greater likelihood that the recognized words are 1341 * correct. This field is set only for the top alternative of a non-streaming 1342 * result or, of a streaming result where `is_final=true`. 1343 * This field is not guaranteed to be accurate and users should not rely on it 1344 * to be always provided. 1345 * The default of 0.0 is a sentinel value indicating `confidence` was not set. 1346 * </pre> 1347 * 1348 * <code>float confidence = 4;</code> 1349 * 1350 * @return This builder for chaining. 1351 */ clearConfidence()1352 public Builder clearConfidence() { 1353 bitField0_ = (bitField0_ & ~0x00000008); 1354 confidence_ = 0F; 1355 onChanged(); 1356 return this; 1357 } 1358 1359 private int speakerTag_; 1360 /** 1361 * 1362 * 1363 * <pre> 1364 * Output only. A distinct integer value is assigned for every speaker within 1365 * the audio. This field specifies which one of those speakers was detected to 1366 * have spoken this word. Value ranges from '1' to diarization_speaker_count. 1367 * speaker_tag is set if enable_speaker_diarization = 'true' and only in the 1368 * top alternative. 1369 * </pre> 1370 * 1371 * <code>int32 speaker_tag = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code> 1372 * 1373 * @return The speakerTag. 1374 */ 1375 @java.lang.Override getSpeakerTag()1376 public int getSpeakerTag() { 1377 return speakerTag_; 1378 } 1379 /** 1380 * 1381 * 1382 * <pre> 1383 * Output only. A distinct integer value is assigned for every speaker within 1384 * the audio. This field specifies which one of those speakers was detected to 1385 * have spoken this word. Value ranges from '1' to diarization_speaker_count. 1386 * speaker_tag is set if enable_speaker_diarization = 'true' and only in the 1387 * top alternative. 1388 * </pre> 1389 * 1390 * <code>int32 speaker_tag = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code> 1391 * 1392 * @param value The speakerTag to set. 1393 * @return This builder for chaining. 1394 */ setSpeakerTag(int value)1395 public Builder setSpeakerTag(int value) { 1396 1397 speakerTag_ = value; 1398 bitField0_ |= 0x00000010; 1399 onChanged(); 1400 return this; 1401 } 1402 /** 1403 * 1404 * 1405 * <pre> 1406 * Output only. A distinct integer value is assigned for every speaker within 1407 * the audio. This field specifies which one of those speakers was detected to 1408 * have spoken this word. Value ranges from '1' to diarization_speaker_count. 1409 * speaker_tag is set if enable_speaker_diarization = 'true' and only in the 1410 * top alternative. 1411 * </pre> 1412 * 1413 * <code>int32 speaker_tag = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code> 1414 * 1415 * @return This builder for chaining. 1416 */ clearSpeakerTag()1417 public Builder clearSpeakerTag() { 1418 bitField0_ = (bitField0_ & ~0x00000010); 1419 speakerTag_ = 0; 1420 onChanged(); 1421 return this; 1422 } 1423 1424 @java.lang.Override setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)1425 public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { 1426 return super.setUnknownFields(unknownFields); 1427 } 1428 1429 @java.lang.Override mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)1430 public final Builder mergeUnknownFields( 1431 final com.google.protobuf.UnknownFieldSet unknownFields) { 1432 return super.mergeUnknownFields(unknownFields); 1433 } 1434 1435 // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1.WordInfo) 1436 } 1437 1438 // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.WordInfo) 1439 private static final com.google.cloud.speech.v1.WordInfo DEFAULT_INSTANCE; 1440 1441 static { 1442 DEFAULT_INSTANCE = new com.google.cloud.speech.v1.WordInfo(); 1443 } 1444 getDefaultInstance()1445 public static com.google.cloud.speech.v1.WordInfo getDefaultInstance() { 1446 return DEFAULT_INSTANCE; 1447 } 1448 1449 private static final com.google.protobuf.Parser<WordInfo> PARSER = 1450 new com.google.protobuf.AbstractParser<WordInfo>() { 1451 @java.lang.Override 1452 public WordInfo parsePartialFrom( 1453 com.google.protobuf.CodedInputStream input, 1454 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1455 throws com.google.protobuf.InvalidProtocolBufferException { 1456 Builder builder = newBuilder(); 1457 try { 1458 builder.mergeFrom(input, extensionRegistry); 1459 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 1460 throw e.setUnfinishedMessage(builder.buildPartial()); 1461 } catch (com.google.protobuf.UninitializedMessageException e) { 1462 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); 1463 } catch (java.io.IOException e) { 1464 throw new com.google.protobuf.InvalidProtocolBufferException(e) 1465 .setUnfinishedMessage(builder.buildPartial()); 1466 } 1467 return builder.buildPartial(); 1468 } 1469 }; 1470 parser()1471 public static com.google.protobuf.Parser<WordInfo> parser() { 1472 return PARSER; 1473 } 1474 1475 @java.lang.Override getParserForType()1476 public com.google.protobuf.Parser<WordInfo> getParserForType() { 1477 return PARSER; 1478 } 1479 1480 @java.lang.Override getDefaultInstanceForType()1481 public com.google.cloud.speech.v1.WordInfo getDefaultInstanceForType() { 1482 return DEFAULT_INSTANCE; 1483 } 1484 } 1485