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 * Provides "hints" to the speech recognizer to favor specific words and phrases 26 * in the results. 27 * </pre> 28 * 29 * Protobuf type {@code google.cloud.speech.v1.SpeechContext} 30 */ 31 public final class SpeechContext extends com.google.protobuf.GeneratedMessageV3 32 implements 33 // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.SpeechContext) 34 SpeechContextOrBuilder { 35 private static final long serialVersionUID = 0L; 36 // Use SpeechContext.newBuilder() to construct. SpeechContext(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)37 private SpeechContext(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { 38 super(builder); 39 } 40 SpeechContext()41 private SpeechContext() { 42 phrases_ = com.google.protobuf.LazyStringArrayList.EMPTY; 43 } 44 45 @java.lang.Override 46 @SuppressWarnings({"unused"}) newInstance(UnusedPrivateParameter unused)47 protected java.lang.Object newInstance(UnusedPrivateParameter unused) { 48 return new SpeechContext(); 49 } 50 51 @java.lang.Override getUnknownFields()52 public final com.google.protobuf.UnknownFieldSet getUnknownFields() { 53 return this.unknownFields; 54 } 55 getDescriptor()56 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 57 return com.google.cloud.speech.v1.SpeechProto 58 .internal_static_google_cloud_speech_v1_SpeechContext_descriptor; 59 } 60 61 @java.lang.Override 62 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()63 internalGetFieldAccessorTable() { 64 return com.google.cloud.speech.v1.SpeechProto 65 .internal_static_google_cloud_speech_v1_SpeechContext_fieldAccessorTable 66 .ensureFieldAccessorsInitialized( 67 com.google.cloud.speech.v1.SpeechContext.class, 68 com.google.cloud.speech.v1.SpeechContext.Builder.class); 69 } 70 71 public static final int PHRASES_FIELD_NUMBER = 1; 72 73 @SuppressWarnings("serial") 74 private com.google.protobuf.LazyStringList phrases_; 75 /** 76 * 77 * 78 * <pre> 79 * A list of strings containing words and phrases "hints" so that 80 * the speech recognition is more likely to recognize them. This can be used 81 * to improve the accuracy for specific words and phrases, for example, if 82 * specific commands are typically spoken by the user. This can also be used 83 * to add additional words to the vocabulary of the recognizer. See 84 * [usage limits](https://cloud.google.com/speech-to-text/quotas#content). 85 * List items can also be set to classes for groups of words that represent 86 * common concepts that occur in natural language. For example, rather than 87 * providing phrase hints for every month of the year, using the $MONTH class 88 * improves the likelihood of correctly transcribing audio that includes 89 * months. 90 * </pre> 91 * 92 * <code>repeated string phrases = 1;</code> 93 * 94 * @return A list containing the phrases. 95 */ getPhrasesList()96 public com.google.protobuf.ProtocolStringList getPhrasesList() { 97 return phrases_; 98 } 99 /** 100 * 101 * 102 * <pre> 103 * A list of strings containing words and phrases "hints" so that 104 * the speech recognition is more likely to recognize them. This can be used 105 * to improve the accuracy for specific words and phrases, for example, if 106 * specific commands are typically spoken by the user. This can also be used 107 * to add additional words to the vocabulary of the recognizer. See 108 * [usage limits](https://cloud.google.com/speech-to-text/quotas#content). 109 * List items can also be set to classes for groups of words that represent 110 * common concepts that occur in natural language. For example, rather than 111 * providing phrase hints for every month of the year, using the $MONTH class 112 * improves the likelihood of correctly transcribing audio that includes 113 * months. 114 * </pre> 115 * 116 * <code>repeated string phrases = 1;</code> 117 * 118 * @return The count of phrases. 119 */ getPhrasesCount()120 public int getPhrasesCount() { 121 return phrases_.size(); 122 } 123 /** 124 * 125 * 126 * <pre> 127 * A list of strings containing words and phrases "hints" so that 128 * the speech recognition is more likely to recognize them. This can be used 129 * to improve the accuracy for specific words and phrases, for example, if 130 * specific commands are typically spoken by the user. This can also be used 131 * to add additional words to the vocabulary of the recognizer. See 132 * [usage limits](https://cloud.google.com/speech-to-text/quotas#content). 133 * List items can also be set to classes for groups of words that represent 134 * common concepts that occur in natural language. For example, rather than 135 * providing phrase hints for every month of the year, using the $MONTH class 136 * improves the likelihood of correctly transcribing audio that includes 137 * months. 138 * </pre> 139 * 140 * <code>repeated string phrases = 1;</code> 141 * 142 * @param index The index of the element to return. 143 * @return The phrases at the given index. 144 */ getPhrases(int index)145 public java.lang.String getPhrases(int index) { 146 return phrases_.get(index); 147 } 148 /** 149 * 150 * 151 * <pre> 152 * A list of strings containing words and phrases "hints" so that 153 * the speech recognition is more likely to recognize them. This can be used 154 * to improve the accuracy for specific words and phrases, for example, if 155 * specific commands are typically spoken by the user. This can also be used 156 * to add additional words to the vocabulary of the recognizer. See 157 * [usage limits](https://cloud.google.com/speech-to-text/quotas#content). 158 * List items can also be set to classes for groups of words that represent 159 * common concepts that occur in natural language. For example, rather than 160 * providing phrase hints for every month of the year, using the $MONTH class 161 * improves the likelihood of correctly transcribing audio that includes 162 * months. 163 * </pre> 164 * 165 * <code>repeated string phrases = 1;</code> 166 * 167 * @param index The index of the value to return. 168 * @return The bytes of the phrases at the given index. 169 */ getPhrasesBytes(int index)170 public com.google.protobuf.ByteString getPhrasesBytes(int index) { 171 return phrases_.getByteString(index); 172 } 173 174 public static final int BOOST_FIELD_NUMBER = 4; 175 private float boost_ = 0F; 176 /** 177 * 178 * 179 * <pre> 180 * Hint Boost. Positive value will increase the probability that a specific 181 * phrase will be recognized over other similar sounding phrases. The higher 182 * the boost, the higher the chance of false positive recognition as well. 183 * Negative boost values would correspond to anti-biasing. Anti-biasing is not 184 * enabled, so negative boost will simply be ignored. Though `boost` can 185 * accept a wide range of positive values, most use cases are best served with 186 * values between 0 and 20. We recommend using a binary search approach to 187 * finding the optimal value for your use case. 188 * </pre> 189 * 190 * <code>float boost = 4;</code> 191 * 192 * @return The boost. 193 */ 194 @java.lang.Override getBoost()195 public float getBoost() { 196 return boost_; 197 } 198 199 private byte memoizedIsInitialized = -1; 200 201 @java.lang.Override isInitialized()202 public final boolean isInitialized() { 203 byte isInitialized = memoizedIsInitialized; 204 if (isInitialized == 1) return true; 205 if (isInitialized == 0) return false; 206 207 memoizedIsInitialized = 1; 208 return true; 209 } 210 211 @java.lang.Override writeTo(com.google.protobuf.CodedOutputStream output)212 public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { 213 for (int i = 0; i < phrases_.size(); i++) { 214 com.google.protobuf.GeneratedMessageV3.writeString(output, 1, phrases_.getRaw(i)); 215 } 216 if (java.lang.Float.floatToRawIntBits(boost_) != 0) { 217 output.writeFloat(4, boost_); 218 } 219 getUnknownFields().writeTo(output); 220 } 221 222 @java.lang.Override getSerializedSize()223 public int getSerializedSize() { 224 int size = memoizedSize; 225 if (size != -1) return size; 226 227 size = 0; 228 { 229 int dataSize = 0; 230 for (int i = 0; i < phrases_.size(); i++) { 231 dataSize += computeStringSizeNoTag(phrases_.getRaw(i)); 232 } 233 size += dataSize; 234 size += 1 * getPhrasesList().size(); 235 } 236 if (java.lang.Float.floatToRawIntBits(boost_) != 0) { 237 size += com.google.protobuf.CodedOutputStream.computeFloatSize(4, boost_); 238 } 239 size += getUnknownFields().getSerializedSize(); 240 memoizedSize = size; 241 return size; 242 } 243 244 @java.lang.Override equals(final java.lang.Object obj)245 public boolean equals(final java.lang.Object obj) { 246 if (obj == this) { 247 return true; 248 } 249 if (!(obj instanceof com.google.cloud.speech.v1.SpeechContext)) { 250 return super.equals(obj); 251 } 252 com.google.cloud.speech.v1.SpeechContext other = (com.google.cloud.speech.v1.SpeechContext) obj; 253 254 if (!getPhrasesList().equals(other.getPhrasesList())) return false; 255 if (java.lang.Float.floatToIntBits(getBoost()) 256 != java.lang.Float.floatToIntBits(other.getBoost())) return false; 257 if (!getUnknownFields().equals(other.getUnknownFields())) return false; 258 return true; 259 } 260 261 @java.lang.Override hashCode()262 public int hashCode() { 263 if (memoizedHashCode != 0) { 264 return memoizedHashCode; 265 } 266 int hash = 41; 267 hash = (19 * hash) + getDescriptor().hashCode(); 268 if (getPhrasesCount() > 0) { 269 hash = (37 * hash) + PHRASES_FIELD_NUMBER; 270 hash = (53 * hash) + getPhrasesList().hashCode(); 271 } 272 hash = (37 * hash) + BOOST_FIELD_NUMBER; 273 hash = (53 * hash) + java.lang.Float.floatToIntBits(getBoost()); 274 hash = (29 * hash) + getUnknownFields().hashCode(); 275 memoizedHashCode = hash; 276 return hash; 277 } 278 parseFrom(java.nio.ByteBuffer data)279 public static com.google.cloud.speech.v1.SpeechContext parseFrom(java.nio.ByteBuffer data) 280 throws com.google.protobuf.InvalidProtocolBufferException { 281 return PARSER.parseFrom(data); 282 } 283 parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)284 public static com.google.cloud.speech.v1.SpeechContext parseFrom( 285 java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 286 throws com.google.protobuf.InvalidProtocolBufferException { 287 return PARSER.parseFrom(data, extensionRegistry); 288 } 289 parseFrom( com.google.protobuf.ByteString data)290 public static com.google.cloud.speech.v1.SpeechContext parseFrom( 291 com.google.protobuf.ByteString data) 292 throws com.google.protobuf.InvalidProtocolBufferException { 293 return PARSER.parseFrom(data); 294 } 295 parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)296 public static com.google.cloud.speech.v1.SpeechContext parseFrom( 297 com.google.protobuf.ByteString data, 298 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 299 throws com.google.protobuf.InvalidProtocolBufferException { 300 return PARSER.parseFrom(data, extensionRegistry); 301 } 302 parseFrom(byte[] data)303 public static com.google.cloud.speech.v1.SpeechContext parseFrom(byte[] data) 304 throws com.google.protobuf.InvalidProtocolBufferException { 305 return PARSER.parseFrom(data); 306 } 307 parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)308 public static com.google.cloud.speech.v1.SpeechContext parseFrom( 309 byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 310 throws com.google.protobuf.InvalidProtocolBufferException { 311 return PARSER.parseFrom(data, extensionRegistry); 312 } 313 parseFrom(java.io.InputStream input)314 public static com.google.cloud.speech.v1.SpeechContext parseFrom(java.io.InputStream input) 315 throws java.io.IOException { 316 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 317 } 318 parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)319 public static com.google.cloud.speech.v1.SpeechContext parseFrom( 320 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 321 throws java.io.IOException { 322 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 323 PARSER, input, extensionRegistry); 324 } 325 parseDelimitedFrom( java.io.InputStream input)326 public static com.google.cloud.speech.v1.SpeechContext parseDelimitedFrom( 327 java.io.InputStream input) throws java.io.IOException { 328 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); 329 } 330 parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)331 public static com.google.cloud.speech.v1.SpeechContext parseDelimitedFrom( 332 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 333 throws java.io.IOException { 334 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( 335 PARSER, input, extensionRegistry); 336 } 337 parseFrom( com.google.protobuf.CodedInputStream input)338 public static com.google.cloud.speech.v1.SpeechContext parseFrom( 339 com.google.protobuf.CodedInputStream input) throws java.io.IOException { 340 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 341 } 342 parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)343 public static com.google.cloud.speech.v1.SpeechContext parseFrom( 344 com.google.protobuf.CodedInputStream input, 345 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 346 throws java.io.IOException { 347 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 348 PARSER, input, extensionRegistry); 349 } 350 351 @java.lang.Override newBuilderForType()352 public Builder newBuilderForType() { 353 return newBuilder(); 354 } 355 newBuilder()356 public static Builder newBuilder() { 357 return DEFAULT_INSTANCE.toBuilder(); 358 } 359 newBuilder(com.google.cloud.speech.v1.SpeechContext prototype)360 public static Builder newBuilder(com.google.cloud.speech.v1.SpeechContext prototype) { 361 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); 362 } 363 364 @java.lang.Override toBuilder()365 public Builder toBuilder() { 366 return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); 367 } 368 369 @java.lang.Override newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)370 protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 371 Builder builder = new Builder(parent); 372 return builder; 373 } 374 /** 375 * 376 * 377 * <pre> 378 * Provides "hints" to the speech recognizer to favor specific words and phrases 379 * in the results. 380 * </pre> 381 * 382 * Protobuf type {@code google.cloud.speech.v1.SpeechContext} 383 */ 384 public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> 385 implements 386 // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1.SpeechContext) 387 com.google.cloud.speech.v1.SpeechContextOrBuilder { getDescriptor()388 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 389 return com.google.cloud.speech.v1.SpeechProto 390 .internal_static_google_cloud_speech_v1_SpeechContext_descriptor; 391 } 392 393 @java.lang.Override 394 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()395 internalGetFieldAccessorTable() { 396 return com.google.cloud.speech.v1.SpeechProto 397 .internal_static_google_cloud_speech_v1_SpeechContext_fieldAccessorTable 398 .ensureFieldAccessorsInitialized( 399 com.google.cloud.speech.v1.SpeechContext.class, 400 com.google.cloud.speech.v1.SpeechContext.Builder.class); 401 } 402 403 // Construct using com.google.cloud.speech.v1.SpeechContext.newBuilder() Builder()404 private Builder() {} 405 Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)406 private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 407 super(parent); 408 } 409 410 @java.lang.Override clear()411 public Builder clear() { 412 super.clear(); 413 bitField0_ = 0; 414 phrases_ = com.google.protobuf.LazyStringArrayList.EMPTY; 415 bitField0_ = (bitField0_ & ~0x00000001); 416 boost_ = 0F; 417 return this; 418 } 419 420 @java.lang.Override getDescriptorForType()421 public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { 422 return com.google.cloud.speech.v1.SpeechProto 423 .internal_static_google_cloud_speech_v1_SpeechContext_descriptor; 424 } 425 426 @java.lang.Override getDefaultInstanceForType()427 public com.google.cloud.speech.v1.SpeechContext getDefaultInstanceForType() { 428 return com.google.cloud.speech.v1.SpeechContext.getDefaultInstance(); 429 } 430 431 @java.lang.Override build()432 public com.google.cloud.speech.v1.SpeechContext build() { 433 com.google.cloud.speech.v1.SpeechContext result = buildPartial(); 434 if (!result.isInitialized()) { 435 throw newUninitializedMessageException(result); 436 } 437 return result; 438 } 439 440 @java.lang.Override buildPartial()441 public com.google.cloud.speech.v1.SpeechContext buildPartial() { 442 com.google.cloud.speech.v1.SpeechContext result = 443 new com.google.cloud.speech.v1.SpeechContext(this); 444 buildPartialRepeatedFields(result); 445 if (bitField0_ != 0) { 446 buildPartial0(result); 447 } 448 onBuilt(); 449 return result; 450 } 451 buildPartialRepeatedFields(com.google.cloud.speech.v1.SpeechContext result)452 private void buildPartialRepeatedFields(com.google.cloud.speech.v1.SpeechContext result) { 453 if (((bitField0_ & 0x00000001) != 0)) { 454 phrases_ = phrases_.getUnmodifiableView(); 455 bitField0_ = (bitField0_ & ~0x00000001); 456 } 457 result.phrases_ = phrases_; 458 } 459 buildPartial0(com.google.cloud.speech.v1.SpeechContext result)460 private void buildPartial0(com.google.cloud.speech.v1.SpeechContext result) { 461 int from_bitField0_ = bitField0_; 462 if (((from_bitField0_ & 0x00000002) != 0)) { 463 result.boost_ = boost_; 464 } 465 } 466 467 @java.lang.Override clone()468 public Builder clone() { 469 return super.clone(); 470 } 471 472 @java.lang.Override setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)473 public Builder setField( 474 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 475 return super.setField(field, value); 476 } 477 478 @java.lang.Override clearField(com.google.protobuf.Descriptors.FieldDescriptor field)479 public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { 480 return super.clearField(field); 481 } 482 483 @java.lang.Override clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)484 public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { 485 return super.clearOneof(oneof); 486 } 487 488 @java.lang.Override setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)489 public Builder setRepeatedField( 490 com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { 491 return super.setRepeatedField(field, index, value); 492 } 493 494 @java.lang.Override addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)495 public Builder addRepeatedField( 496 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 497 return super.addRepeatedField(field, value); 498 } 499 500 @java.lang.Override mergeFrom(com.google.protobuf.Message other)501 public Builder mergeFrom(com.google.protobuf.Message other) { 502 if (other instanceof com.google.cloud.speech.v1.SpeechContext) { 503 return mergeFrom((com.google.cloud.speech.v1.SpeechContext) other); 504 } else { 505 super.mergeFrom(other); 506 return this; 507 } 508 } 509 mergeFrom(com.google.cloud.speech.v1.SpeechContext other)510 public Builder mergeFrom(com.google.cloud.speech.v1.SpeechContext other) { 511 if (other == com.google.cloud.speech.v1.SpeechContext.getDefaultInstance()) return this; 512 if (!other.phrases_.isEmpty()) { 513 if (phrases_.isEmpty()) { 514 phrases_ = other.phrases_; 515 bitField0_ = (bitField0_ & ~0x00000001); 516 } else { 517 ensurePhrasesIsMutable(); 518 phrases_.addAll(other.phrases_); 519 } 520 onChanged(); 521 } 522 if (other.getBoost() != 0F) { 523 setBoost(other.getBoost()); 524 } 525 this.mergeUnknownFields(other.getUnknownFields()); 526 onChanged(); 527 return this; 528 } 529 530 @java.lang.Override isInitialized()531 public final boolean isInitialized() { 532 return true; 533 } 534 535 @java.lang.Override mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)536 public Builder mergeFrom( 537 com.google.protobuf.CodedInputStream input, 538 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 539 throws java.io.IOException { 540 if (extensionRegistry == null) { 541 throw new java.lang.NullPointerException(); 542 } 543 try { 544 boolean done = false; 545 while (!done) { 546 int tag = input.readTag(); 547 switch (tag) { 548 case 0: 549 done = true; 550 break; 551 case 10: 552 { 553 java.lang.String s = input.readStringRequireUtf8(); 554 ensurePhrasesIsMutable(); 555 phrases_.add(s); 556 break; 557 } // case 10 558 case 37: 559 { 560 boost_ = input.readFloat(); 561 bitField0_ |= 0x00000002; 562 break; 563 } // case 37 564 default: 565 { 566 if (!super.parseUnknownField(input, extensionRegistry, tag)) { 567 done = true; // was an endgroup tag 568 } 569 break; 570 } // default: 571 } // switch (tag) 572 } // while (!done) 573 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 574 throw e.unwrapIOException(); 575 } finally { 576 onChanged(); 577 } // finally 578 return this; 579 } 580 581 private int bitField0_; 582 583 private com.google.protobuf.LazyStringList phrases_ = 584 com.google.protobuf.LazyStringArrayList.EMPTY; 585 ensurePhrasesIsMutable()586 private void ensurePhrasesIsMutable() { 587 if (!((bitField0_ & 0x00000001) != 0)) { 588 phrases_ = new com.google.protobuf.LazyStringArrayList(phrases_); 589 bitField0_ |= 0x00000001; 590 } 591 } 592 /** 593 * 594 * 595 * <pre> 596 * A list of strings containing words and phrases "hints" so that 597 * the speech recognition is more likely to recognize them. This can be used 598 * to improve the accuracy for specific words and phrases, for example, if 599 * specific commands are typically spoken by the user. This can also be used 600 * to add additional words to the vocabulary of the recognizer. See 601 * [usage limits](https://cloud.google.com/speech-to-text/quotas#content). 602 * List items can also be set to classes for groups of words that represent 603 * common concepts that occur in natural language. For example, rather than 604 * providing phrase hints for every month of the year, using the $MONTH class 605 * improves the likelihood of correctly transcribing audio that includes 606 * months. 607 * </pre> 608 * 609 * <code>repeated string phrases = 1;</code> 610 * 611 * @return A list containing the phrases. 612 */ getPhrasesList()613 public com.google.protobuf.ProtocolStringList getPhrasesList() { 614 return phrases_.getUnmodifiableView(); 615 } 616 /** 617 * 618 * 619 * <pre> 620 * A list of strings containing words and phrases "hints" so that 621 * the speech recognition is more likely to recognize them. This can be used 622 * to improve the accuracy for specific words and phrases, for example, if 623 * specific commands are typically spoken by the user. This can also be used 624 * to add additional words to the vocabulary of the recognizer. See 625 * [usage limits](https://cloud.google.com/speech-to-text/quotas#content). 626 * List items can also be set to classes for groups of words that represent 627 * common concepts that occur in natural language. For example, rather than 628 * providing phrase hints for every month of the year, using the $MONTH class 629 * improves the likelihood of correctly transcribing audio that includes 630 * months. 631 * </pre> 632 * 633 * <code>repeated string phrases = 1;</code> 634 * 635 * @return The count of phrases. 636 */ getPhrasesCount()637 public int getPhrasesCount() { 638 return phrases_.size(); 639 } 640 /** 641 * 642 * 643 * <pre> 644 * A list of strings containing words and phrases "hints" so that 645 * the speech recognition is more likely to recognize them. This can be used 646 * to improve the accuracy for specific words and phrases, for example, if 647 * specific commands are typically spoken by the user. This can also be used 648 * to add additional words to the vocabulary of the recognizer. See 649 * [usage limits](https://cloud.google.com/speech-to-text/quotas#content). 650 * List items can also be set to classes for groups of words that represent 651 * common concepts that occur in natural language. For example, rather than 652 * providing phrase hints for every month of the year, using the $MONTH class 653 * improves the likelihood of correctly transcribing audio that includes 654 * months. 655 * </pre> 656 * 657 * <code>repeated string phrases = 1;</code> 658 * 659 * @param index The index of the element to return. 660 * @return The phrases at the given index. 661 */ getPhrases(int index)662 public java.lang.String getPhrases(int index) { 663 return phrases_.get(index); 664 } 665 /** 666 * 667 * 668 * <pre> 669 * A list of strings containing words and phrases "hints" so that 670 * the speech recognition is more likely to recognize them. This can be used 671 * to improve the accuracy for specific words and phrases, for example, if 672 * specific commands are typically spoken by the user. This can also be used 673 * to add additional words to the vocabulary of the recognizer. See 674 * [usage limits](https://cloud.google.com/speech-to-text/quotas#content). 675 * List items can also be set to classes for groups of words that represent 676 * common concepts that occur in natural language. For example, rather than 677 * providing phrase hints for every month of the year, using the $MONTH class 678 * improves the likelihood of correctly transcribing audio that includes 679 * months. 680 * </pre> 681 * 682 * <code>repeated string phrases = 1;</code> 683 * 684 * @param index The index of the value to return. 685 * @return The bytes of the phrases at the given index. 686 */ getPhrasesBytes(int index)687 public com.google.protobuf.ByteString getPhrasesBytes(int index) { 688 return phrases_.getByteString(index); 689 } 690 /** 691 * 692 * 693 * <pre> 694 * A list of strings containing words and phrases "hints" so that 695 * the speech recognition is more likely to recognize them. This can be used 696 * to improve the accuracy for specific words and phrases, for example, if 697 * specific commands are typically spoken by the user. This can also be used 698 * to add additional words to the vocabulary of the recognizer. See 699 * [usage limits](https://cloud.google.com/speech-to-text/quotas#content). 700 * List items can also be set to classes for groups of words that represent 701 * common concepts that occur in natural language. For example, rather than 702 * providing phrase hints for every month of the year, using the $MONTH class 703 * improves the likelihood of correctly transcribing audio that includes 704 * months. 705 * </pre> 706 * 707 * <code>repeated string phrases = 1;</code> 708 * 709 * @param index The index to set the value at. 710 * @param value The phrases to set. 711 * @return This builder for chaining. 712 */ setPhrases(int index, java.lang.String value)713 public Builder setPhrases(int index, java.lang.String value) { 714 if (value == null) { 715 throw new NullPointerException(); 716 } 717 ensurePhrasesIsMutable(); 718 phrases_.set(index, value); 719 onChanged(); 720 return this; 721 } 722 /** 723 * 724 * 725 * <pre> 726 * A list of strings containing words and phrases "hints" so that 727 * the speech recognition is more likely to recognize them. This can be used 728 * to improve the accuracy for specific words and phrases, for example, if 729 * specific commands are typically spoken by the user. This can also be used 730 * to add additional words to the vocabulary of the recognizer. See 731 * [usage limits](https://cloud.google.com/speech-to-text/quotas#content). 732 * List items can also be set to classes for groups of words that represent 733 * common concepts that occur in natural language. For example, rather than 734 * providing phrase hints for every month of the year, using the $MONTH class 735 * improves the likelihood of correctly transcribing audio that includes 736 * months. 737 * </pre> 738 * 739 * <code>repeated string phrases = 1;</code> 740 * 741 * @param value The phrases to add. 742 * @return This builder for chaining. 743 */ addPhrases(java.lang.String value)744 public Builder addPhrases(java.lang.String value) { 745 if (value == null) { 746 throw new NullPointerException(); 747 } 748 ensurePhrasesIsMutable(); 749 phrases_.add(value); 750 onChanged(); 751 return this; 752 } 753 /** 754 * 755 * 756 * <pre> 757 * A list of strings containing words and phrases "hints" so that 758 * the speech recognition is more likely to recognize them. This can be used 759 * to improve the accuracy for specific words and phrases, for example, if 760 * specific commands are typically spoken by the user. This can also be used 761 * to add additional words to the vocabulary of the recognizer. See 762 * [usage limits](https://cloud.google.com/speech-to-text/quotas#content). 763 * List items can also be set to classes for groups of words that represent 764 * common concepts that occur in natural language. For example, rather than 765 * providing phrase hints for every month of the year, using the $MONTH class 766 * improves the likelihood of correctly transcribing audio that includes 767 * months. 768 * </pre> 769 * 770 * <code>repeated string phrases = 1;</code> 771 * 772 * @param values The phrases to add. 773 * @return This builder for chaining. 774 */ addAllPhrases(java.lang.Iterable<java.lang.String> values)775 public Builder addAllPhrases(java.lang.Iterable<java.lang.String> values) { 776 ensurePhrasesIsMutable(); 777 com.google.protobuf.AbstractMessageLite.Builder.addAll(values, phrases_); 778 onChanged(); 779 return this; 780 } 781 /** 782 * 783 * 784 * <pre> 785 * A list of strings containing words and phrases "hints" so that 786 * the speech recognition is more likely to recognize them. This can be used 787 * to improve the accuracy for specific words and phrases, for example, if 788 * specific commands are typically spoken by the user. This can also be used 789 * to add additional words to the vocabulary of the recognizer. See 790 * [usage limits](https://cloud.google.com/speech-to-text/quotas#content). 791 * List items can also be set to classes for groups of words that represent 792 * common concepts that occur in natural language. For example, rather than 793 * providing phrase hints for every month of the year, using the $MONTH class 794 * improves the likelihood of correctly transcribing audio that includes 795 * months. 796 * </pre> 797 * 798 * <code>repeated string phrases = 1;</code> 799 * 800 * @return This builder for chaining. 801 */ clearPhrases()802 public Builder clearPhrases() { 803 phrases_ = com.google.protobuf.LazyStringArrayList.EMPTY; 804 bitField0_ = (bitField0_ & ~0x00000001); 805 onChanged(); 806 return this; 807 } 808 /** 809 * 810 * 811 * <pre> 812 * A list of strings containing words and phrases "hints" so that 813 * the speech recognition is more likely to recognize them. This can be used 814 * to improve the accuracy for specific words and phrases, for example, if 815 * specific commands are typically spoken by the user. This can also be used 816 * to add additional words to the vocabulary of the recognizer. See 817 * [usage limits](https://cloud.google.com/speech-to-text/quotas#content). 818 * List items can also be set to classes for groups of words that represent 819 * common concepts that occur in natural language. For example, rather than 820 * providing phrase hints for every month of the year, using the $MONTH class 821 * improves the likelihood of correctly transcribing audio that includes 822 * months. 823 * </pre> 824 * 825 * <code>repeated string phrases = 1;</code> 826 * 827 * @param value The bytes of the phrases to add. 828 * @return This builder for chaining. 829 */ addPhrasesBytes(com.google.protobuf.ByteString value)830 public Builder addPhrasesBytes(com.google.protobuf.ByteString value) { 831 if (value == null) { 832 throw new NullPointerException(); 833 } 834 checkByteStringIsUtf8(value); 835 ensurePhrasesIsMutable(); 836 phrases_.add(value); 837 onChanged(); 838 return this; 839 } 840 841 private float boost_; 842 /** 843 * 844 * 845 * <pre> 846 * Hint Boost. Positive value will increase the probability that a specific 847 * phrase will be recognized over other similar sounding phrases. The higher 848 * the boost, the higher the chance of false positive recognition as well. 849 * Negative boost values would correspond to anti-biasing. Anti-biasing is not 850 * enabled, so negative boost will simply be ignored. Though `boost` can 851 * accept a wide range of positive values, most use cases are best served with 852 * values between 0 and 20. We recommend using a binary search approach to 853 * finding the optimal value for your use case. 854 * </pre> 855 * 856 * <code>float boost = 4;</code> 857 * 858 * @return The boost. 859 */ 860 @java.lang.Override getBoost()861 public float getBoost() { 862 return boost_; 863 } 864 /** 865 * 866 * 867 * <pre> 868 * Hint Boost. Positive value will increase the probability that a specific 869 * phrase will be recognized over other similar sounding phrases. The higher 870 * the boost, the higher the chance of false positive recognition as well. 871 * Negative boost values would correspond to anti-biasing. Anti-biasing is not 872 * enabled, so negative boost will simply be ignored. Though `boost` can 873 * accept a wide range of positive values, most use cases are best served with 874 * values between 0 and 20. We recommend using a binary search approach to 875 * finding the optimal value for your use case. 876 * </pre> 877 * 878 * <code>float boost = 4;</code> 879 * 880 * @param value The boost to set. 881 * @return This builder for chaining. 882 */ setBoost(float value)883 public Builder setBoost(float value) { 884 885 boost_ = value; 886 bitField0_ |= 0x00000002; 887 onChanged(); 888 return this; 889 } 890 /** 891 * 892 * 893 * <pre> 894 * Hint Boost. Positive value will increase the probability that a specific 895 * phrase will be recognized over other similar sounding phrases. The higher 896 * the boost, the higher the chance of false positive recognition as well. 897 * Negative boost values would correspond to anti-biasing. Anti-biasing is not 898 * enabled, so negative boost will simply be ignored. Though `boost` can 899 * accept a wide range of positive values, most use cases are best served with 900 * values between 0 and 20. We recommend using a binary search approach to 901 * finding the optimal value for your use case. 902 * </pre> 903 * 904 * <code>float boost = 4;</code> 905 * 906 * @return This builder for chaining. 907 */ clearBoost()908 public Builder clearBoost() { 909 bitField0_ = (bitField0_ & ~0x00000002); 910 boost_ = 0F; 911 onChanged(); 912 return this; 913 } 914 915 @java.lang.Override setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)916 public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { 917 return super.setUnknownFields(unknownFields); 918 } 919 920 @java.lang.Override mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)921 public final Builder mergeUnknownFields( 922 final com.google.protobuf.UnknownFieldSet unknownFields) { 923 return super.mergeUnknownFields(unknownFields); 924 } 925 926 // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1.SpeechContext) 927 } 928 929 // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.SpeechContext) 930 private static final com.google.cloud.speech.v1.SpeechContext DEFAULT_INSTANCE; 931 932 static { 933 DEFAULT_INSTANCE = new com.google.cloud.speech.v1.SpeechContext(); 934 } 935 getDefaultInstance()936 public static com.google.cloud.speech.v1.SpeechContext getDefaultInstance() { 937 return DEFAULT_INSTANCE; 938 } 939 940 private static final com.google.protobuf.Parser<SpeechContext> PARSER = 941 new com.google.protobuf.AbstractParser<SpeechContext>() { 942 @java.lang.Override 943 public SpeechContext parsePartialFrom( 944 com.google.protobuf.CodedInputStream input, 945 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 946 throws com.google.protobuf.InvalidProtocolBufferException { 947 Builder builder = newBuilder(); 948 try { 949 builder.mergeFrom(input, extensionRegistry); 950 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 951 throw e.setUnfinishedMessage(builder.buildPartial()); 952 } catch (com.google.protobuf.UninitializedMessageException e) { 953 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); 954 } catch (java.io.IOException e) { 955 throw new com.google.protobuf.InvalidProtocolBufferException(e) 956 .setUnfinishedMessage(builder.buildPartial()); 957 } 958 return builder.buildPartial(); 959 } 960 }; 961 parser()962 public static com.google.protobuf.Parser<SpeechContext> parser() { 963 return PARSER; 964 } 965 966 @java.lang.Override getParserForType()967 public com.google.protobuf.Parser<SpeechContext> getParserForType() { 968 return PARSER; 969 } 970 971 @java.lang.Override getDefaultInstanceForType()972 public com.google.cloud.speech.v1.SpeechContext getDefaultInstanceForType() { 973 return DEFAULT_INSTANCE; 974 } 975 } 976