diff --git a/java-document-ai/README.md b/java-document-ai/README.md
index 3af6e2a0a6f0..0b47998eb002 100644
--- a/java-document-ai/README.md
+++ b/java-document-ai/README.md
@@ -19,20 +19,20 @@ If you are using Maven, add this to your pom.xml file:
+ * A list of advanced OCR options to further fine-tune OCR behavior. + *+ * + *
repeated string advanced_ocr_options = 5;
+ *
+ * @return A list containing the advancedOcrOptions.
+ */
+ public com.google.protobuf.ProtocolStringList getAdvancedOcrOptionsList() {
+ return advancedOcrOptions_;
+ }
+ /**
+ *
+ *
+ * + * A list of advanced OCR options to further fine-tune OCR behavior. + *+ * + *
repeated string advanced_ocr_options = 5;
+ *
+ * @return The count of advancedOcrOptions.
+ */
+ public int getAdvancedOcrOptionsCount() {
+ return advancedOcrOptions_.size();
+ }
+ /**
+ *
+ *
+ * + * A list of advanced OCR options to further fine-tune OCR behavior. + *+ * + *
repeated string advanced_ocr_options = 5;
+ *
+ * @param index The index of the element to return.
+ * @return The advancedOcrOptions at the given index.
+ */
+ public java.lang.String getAdvancedOcrOptions(int index) {
+ return advancedOcrOptions_.get(index);
+ }
+ /**
+ *
+ *
+ * + * A list of advanced OCR options to further fine-tune OCR behavior. + *+ * + *
repeated string advanced_ocr_options = 5;
+ *
+ * @param index The index of the value to return.
+ * @return The bytes of the advancedOcrOptions at the given index.
+ */
+ public com.google.protobuf.ByteString getAdvancedOcrOptionsBytes(int index) {
+ return advancedOcrOptions_.getByteString(index);
+ }
+
private byte memoizedIsInitialized = -1;
@java.lang.Override
@@ -101,6 +166,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io
if (enableNativePdfParsing_ != false) {
output.writeBool(3, enableNativePdfParsing_);
}
+ for (int i = 0; i < advancedOcrOptions_.size(); i++) {
+ com.google.protobuf.GeneratedMessageV3.writeString(output, 5, advancedOcrOptions_.getRaw(i));
+ }
getUnknownFields().writeTo(output);
}
@@ -113,6 +181,14 @@ public int getSerializedSize() {
if (enableNativePdfParsing_ != false) {
size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, enableNativePdfParsing_);
}
+ {
+ int dataSize = 0;
+ for (int i = 0; i < advancedOcrOptions_.size(); i++) {
+ dataSize += computeStringSizeNoTag(advancedOcrOptions_.getRaw(i));
+ }
+ size += dataSize;
+ size += 1 * getAdvancedOcrOptionsList().size();
+ }
size += getUnknownFields().getSerializedSize();
memoizedSize = size;
return size;
@@ -130,6 +206,7 @@ public boolean equals(final java.lang.Object obj) {
(com.google.cloud.documentai.v1beta3.OcrConfig) obj;
if (getEnableNativePdfParsing() != other.getEnableNativePdfParsing()) return false;
+ if (!getAdvancedOcrOptionsList().equals(other.getAdvancedOcrOptionsList())) return false;
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
return true;
}
@@ -143,6 +220,10 @@ public int hashCode() {
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + ENABLE_NATIVE_PDF_PARSING_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getEnableNativePdfParsing());
+ if (getAdvancedOcrOptionsCount() > 0) {
+ hash = (37 * hash) + ADVANCED_OCR_OPTIONS_FIELD_NUMBER;
+ hash = (53 * hash) + getAdvancedOcrOptionsList().hashCode();
+ }
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
@@ -283,6 +364,8 @@ public Builder clear() {
super.clear();
bitField0_ = 0;
enableNativePdfParsing_ = false;
+ advancedOcrOptions_ = com.google.protobuf.LazyStringArrayList.EMPTY;
+ bitField0_ = (bitField0_ & ~0x00000002);
return this;
}
@@ -310,6 +393,7 @@ public com.google.cloud.documentai.v1beta3.OcrConfig build() {
public com.google.cloud.documentai.v1beta3.OcrConfig buildPartial() {
com.google.cloud.documentai.v1beta3.OcrConfig result =
new com.google.cloud.documentai.v1beta3.OcrConfig(this);
+ buildPartialRepeatedFields(result);
if (bitField0_ != 0) {
buildPartial0(result);
}
@@ -317,6 +401,14 @@ public com.google.cloud.documentai.v1beta3.OcrConfig buildPartial() {
return result;
}
+ private void buildPartialRepeatedFields(com.google.cloud.documentai.v1beta3.OcrConfig result) {
+ if (((bitField0_ & 0x00000002) != 0)) {
+ advancedOcrOptions_ = advancedOcrOptions_.getUnmodifiableView();
+ bitField0_ = (bitField0_ & ~0x00000002);
+ }
+ result.advancedOcrOptions_ = advancedOcrOptions_;
+ }
+
private void buildPartial0(com.google.cloud.documentai.v1beta3.OcrConfig result) {
int from_bitField0_ = bitField0_;
if (((from_bitField0_ & 0x00000001) != 0)) {
@@ -372,6 +464,16 @@ public Builder mergeFrom(com.google.cloud.documentai.v1beta3.OcrConfig other) {
if (other.getEnableNativePdfParsing() != false) {
setEnableNativePdfParsing(other.getEnableNativePdfParsing());
}
+ if (!other.advancedOcrOptions_.isEmpty()) {
+ if (advancedOcrOptions_.isEmpty()) {
+ advancedOcrOptions_ = other.advancedOcrOptions_;
+ bitField0_ = (bitField0_ & ~0x00000002);
+ } else {
+ ensureAdvancedOcrOptionsIsMutable();
+ advancedOcrOptions_.addAll(other.advancedOcrOptions_);
+ }
+ onChanged();
+ }
this.mergeUnknownFields(other.getUnknownFields());
onChanged();
return this;
@@ -404,6 +506,13 @@ public Builder mergeFrom(
bitField0_ |= 0x00000001;
break;
} // case 24
+ case 42:
+ {
+ java.lang.String s = input.readStringRequireUtf8();
+ ensureAdvancedOcrOptionsIsMutable();
+ advancedOcrOptions_.add(s);
+ break;
+ } // case 42
default:
{
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
@@ -479,6 +588,174 @@ public Builder clearEnableNativePdfParsing() {
return this;
}
+ private com.google.protobuf.LazyStringList advancedOcrOptions_ =
+ com.google.protobuf.LazyStringArrayList.EMPTY;
+
+ private void ensureAdvancedOcrOptionsIsMutable() {
+ if (!((bitField0_ & 0x00000002) != 0)) {
+ advancedOcrOptions_ = new com.google.protobuf.LazyStringArrayList(advancedOcrOptions_);
+ bitField0_ |= 0x00000002;
+ }
+ }
+ /**
+ *
+ *
+ * + * A list of advanced OCR options to further fine-tune OCR behavior. + *+ * + *
repeated string advanced_ocr_options = 5;
+ *
+ * @return A list containing the advancedOcrOptions.
+ */
+ public com.google.protobuf.ProtocolStringList getAdvancedOcrOptionsList() {
+ return advancedOcrOptions_.getUnmodifiableView();
+ }
+ /**
+ *
+ *
+ * + * A list of advanced OCR options to further fine-tune OCR behavior. + *+ * + *
repeated string advanced_ocr_options = 5;
+ *
+ * @return The count of advancedOcrOptions.
+ */
+ public int getAdvancedOcrOptionsCount() {
+ return advancedOcrOptions_.size();
+ }
+ /**
+ *
+ *
+ * + * A list of advanced OCR options to further fine-tune OCR behavior. + *+ * + *
repeated string advanced_ocr_options = 5;
+ *
+ * @param index The index of the element to return.
+ * @return The advancedOcrOptions at the given index.
+ */
+ public java.lang.String getAdvancedOcrOptions(int index) {
+ return advancedOcrOptions_.get(index);
+ }
+ /**
+ *
+ *
+ * + * A list of advanced OCR options to further fine-tune OCR behavior. + *+ * + *
repeated string advanced_ocr_options = 5;
+ *
+ * @param index The index of the value to return.
+ * @return The bytes of the advancedOcrOptions at the given index.
+ */
+ public com.google.protobuf.ByteString getAdvancedOcrOptionsBytes(int index) {
+ return advancedOcrOptions_.getByteString(index);
+ }
+ /**
+ *
+ *
+ * + * A list of advanced OCR options to further fine-tune OCR behavior. + *+ * + *
repeated string advanced_ocr_options = 5;
+ *
+ * @param index The index to set the value at.
+ * @param value The advancedOcrOptions to set.
+ * @return This builder for chaining.
+ */
+ public Builder setAdvancedOcrOptions(int index, java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureAdvancedOcrOptionsIsMutable();
+ advancedOcrOptions_.set(index, value);
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ * + * A list of advanced OCR options to further fine-tune OCR behavior. + *+ * + *
repeated string advanced_ocr_options = 5;
+ *
+ * @param value The advancedOcrOptions to add.
+ * @return This builder for chaining.
+ */
+ public Builder addAdvancedOcrOptions(java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureAdvancedOcrOptionsIsMutable();
+ advancedOcrOptions_.add(value);
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ * + * A list of advanced OCR options to further fine-tune OCR behavior. + *+ * + *
repeated string advanced_ocr_options = 5;
+ *
+ * @param values The advancedOcrOptions to add.
+ * @return This builder for chaining.
+ */
+ public Builder addAllAdvancedOcrOptions(java.lang.Iterable+ * A list of advanced OCR options to further fine-tune OCR behavior. + *+ * + *
repeated string advanced_ocr_options = 5;
+ *
+ * @return This builder for chaining.
+ */
+ public Builder clearAdvancedOcrOptions() {
+ advancedOcrOptions_ = com.google.protobuf.LazyStringArrayList.EMPTY;
+ bitField0_ = (bitField0_ & ~0x00000002);
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ * + * A list of advanced OCR options to further fine-tune OCR behavior. + *+ * + *
repeated string advanced_ocr_options = 5;
+ *
+ * @param value The bytes of the advancedOcrOptions to add.
+ * @return This builder for chaining.
+ */
+ public Builder addAdvancedOcrOptionsBytes(com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ checkByteStringIsUtf8(value);
+ ensureAdvancedOcrOptionsIsMutable();
+ advancedOcrOptions_.add(value);
+ onChanged();
+ return this;
+ }
+
@java.lang.Override
public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
diff --git a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/OcrConfigOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/OcrConfigOrBuilder.java
index afd96e950340..7ef77f0e1c60 100644
--- a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/OcrConfigOrBuilder.java
+++ b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/OcrConfigOrBuilder.java
@@ -36,4 +36,55 @@ public interface OcrConfigOrBuilder
* @return The enableNativePdfParsing.
*/
boolean getEnableNativePdfParsing();
+
+ /**
+ *
+ *
+ * + * A list of advanced OCR options to further fine-tune OCR behavior. + *+ * + *
repeated string advanced_ocr_options = 5;
+ *
+ * @return A list containing the advancedOcrOptions.
+ */
+ java.util.List+ * A list of advanced OCR options to further fine-tune OCR behavior. + *+ * + *
repeated string advanced_ocr_options = 5;
+ *
+ * @return The count of advancedOcrOptions.
+ */
+ int getAdvancedOcrOptionsCount();
+ /**
+ *
+ *
+ * + * A list of advanced OCR options to further fine-tune OCR behavior. + *+ * + *
repeated string advanced_ocr_options = 5;
+ *
+ * @param index The index of the element to return.
+ * @return The advancedOcrOptions at the given index.
+ */
+ java.lang.String getAdvancedOcrOptions(int index);
+ /**
+ *
+ *
+ * + * A list of advanced OCR options to further fine-tune OCR behavior. + *+ * + *
repeated string advanced_ocr_options = 5;
+ *
+ * @param index The index of the value to return.
+ * @return The bytes of the advancedOcrOptions at the given index.
+ */
+ com.google.protobuf.ByteString getAdvancedOcrOptionsBytes(int index);
}
diff --git a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/proto/google/cloud/documentai/v1beta3/document_io.proto b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/proto/google/cloud/documentai/v1beta3/document_io.proto
index d6a7fb1c4084..2b441c7c17e9 100644
--- a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/proto/google/cloud/documentai/v1beta3/document_io.proto
+++ b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/proto/google/cloud/documentai/v1beta3/document_io.proto
@@ -107,4 +107,7 @@ message OcrConfig {
// Enables special handling for PDFs with existing text information. Results
// in better text extraction quality in such PDF inputs.
bool enable_native_pdf_parsing = 3;
+
+ // A list of advanced OCR options to further fine-tune OCR behavior.
+ repeated string advanced_ocr_options = 5;
}