From 828f045563eff5668dc95f628745716978759788 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 10 Aug 2022 13:50:55 -0700 Subject: [PATCH] feat: Add TextDetectionParams.advanced_ocr_options (#1034) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: Add TextDetectionParams.advanced_ocr_options Advanced OCR options allow users to customize behavior for a specific OCR engine version. PiperOrigin-RevId: 465402148 Source-Link: https://github.com/googleapis/googleapis/commit/ad64930eaf928b006c55914d8319b84670eeaf67 Source-Link: https://github.com/googleapis/googleapis-gen/commit/5d2c8b2b1cb0d15bf7243513a5543a9ec3ecd778 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNWQyYzhiMmIxY2IwZDE1YmY3MjQzNTEzYTU1NDNhOWVjM2VjZDc3OCJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../cloud/vision/v1/image_annotator.proto | 3 + .../vision/v1p1beta1/image_annotator.proto | 3 + .../vision/v1p2beta1/image_annotator.proto | 3 + .../vision/v1p3beta1/image_annotator.proto | 3 + .../vision/v1p4beta1/image_annotator.proto | 3 + protos/protos.d.ts | 30 +++ protos/protos.js | 195 ++++++++++++++++++ protos/protos.json | 25 +++ 8 files changed, 265 insertions(+) diff --git a/protos/google/cloud/vision/v1/image_annotator.proto b/protos/google/cloud/vision/v1/image_annotator.proto index a70c7fdc..10464b0e 100644 --- a/protos/google/cloud/vision/v1/image_annotator.proto +++ b/protos/google/cloud/vision/v1/image_annotator.proto @@ -654,6 +654,9 @@ message TextDetectionParams { // DOCUMENT_TEXT_DETECTION result. Set the flag to true to include confidence // score for TEXT_DETECTION as well. bool enable_text_detection_confidence_score = 9; + + // A list of advanced OCR options to fine-tune OCR behavior. + repeated string advanced_ocr_options = 11; } // Image context and/or feature-specific parameters. diff --git a/protos/google/cloud/vision/v1p1beta1/image_annotator.proto b/protos/google/cloud/vision/v1p1beta1/image_annotator.proto index daf6a2d2..729a0fa0 100644 --- a/protos/google/cloud/vision/v1p1beta1/image_annotator.proto +++ b/protos/google/cloud/vision/v1p1beta1/image_annotator.proto @@ -498,6 +498,9 @@ message TextDetectionParams { // DOCUMENT_TEXT_DETECTION result. Set the flag to true to include confidence // score for TEXT_DETECTION as well. bool enable_text_detection_confidence_score = 9; + + // A list of advanced OCR options to fine-tune OCR behavior. + repeated string advanced_ocr_options = 11; } // Image context and/or feature-specific parameters. diff --git a/protos/google/cloud/vision/v1p2beta1/image_annotator.proto b/protos/google/cloud/vision/v1p2beta1/image_annotator.proto index eaf5abf0..5fc3163c 100644 --- a/protos/google/cloud/vision/v1p2beta1/image_annotator.proto +++ b/protos/google/cloud/vision/v1p2beta1/image_annotator.proto @@ -529,6 +529,9 @@ message TextDetectionParams { // DOCUMENT_TEXT_DETECTION result. Set the flag to true to include confidence // score for TEXT_DETECTION as well. bool enable_text_detection_confidence_score = 9; + + // A list of advanced OCR options to fine-tune OCR behavior. + repeated string advanced_ocr_options = 11; } // Image context and/or feature-specific parameters. diff --git a/protos/google/cloud/vision/v1p3beta1/image_annotator.proto b/protos/google/cloud/vision/v1p3beta1/image_annotator.proto index 5f211178..ca0b4e86 100644 --- a/protos/google/cloud/vision/v1p3beta1/image_annotator.proto +++ b/protos/google/cloud/vision/v1p3beta1/image_annotator.proto @@ -557,6 +557,9 @@ message TextDetectionParams { // DOCUMENT_TEXT_DETECTION result. Set the flag to true to include confidence // score for TEXT_DETECTION as well. bool enable_text_detection_confidence_score = 9; + + // A list of advanced OCR options to fine-tune OCR behavior. + repeated string advanced_ocr_options = 11; } // Image context and/or feature-specific parameters. diff --git a/protos/google/cloud/vision/v1p4beta1/image_annotator.proto b/protos/google/cloud/vision/v1p4beta1/image_annotator.proto index 07217f39..6d7f3dd1 100644 --- a/protos/google/cloud/vision/v1p4beta1/image_annotator.proto +++ b/protos/google/cloud/vision/v1p4beta1/image_annotator.proto @@ -628,6 +628,9 @@ message TextDetectionParams { // DOCUMENT_TEXT_DETECTION result. Set the flag to true to include confidence // score for TEXT_DETECTION as well. bool enable_text_detection_confidence_score = 9; + + // A list of advanced OCR options to fine-tune OCR behavior. + repeated string advanced_ocr_options = 11; } // Image context and/or feature-specific parameters. diff --git a/protos/protos.d.ts b/protos/protos.d.ts index daec4b34..b72c7a2f 100644 --- a/protos/protos.d.ts +++ b/protos/protos.d.ts @@ -2478,6 +2478,9 @@ export namespace google { /** TextDetectionParams enableTextDetectionConfidenceScore */ enableTextDetectionConfidenceScore?: (boolean|null); + + /** TextDetectionParams advancedOcrOptions */ + advancedOcrOptions?: (string[]|null); } /** Represents a TextDetectionParams. */ @@ -2492,6 +2495,9 @@ export namespace google { /** TextDetectionParams enableTextDetectionConfidenceScore. */ public enableTextDetectionConfidenceScore: boolean; + /** TextDetectionParams advancedOcrOptions. */ + public advancedOcrOptions: string[]; + /** * Creates a new TextDetectionParams instance using the specified properties. * @param [properties] Properties to set @@ -12453,6 +12459,9 @@ export namespace google { /** TextDetectionParams enableTextDetectionConfidenceScore */ enableTextDetectionConfidenceScore?: (boolean|null); + + /** TextDetectionParams advancedOcrOptions */ + advancedOcrOptions?: (string[]|null); } /** Represents a TextDetectionParams. */ @@ -12467,6 +12476,9 @@ export namespace google { /** TextDetectionParams enableTextDetectionConfidenceScore. */ public enableTextDetectionConfidenceScore: boolean; + /** TextDetectionParams advancedOcrOptions. */ + public advancedOcrOptions: string[]; + /** * Creates a new TextDetectionParams instance using the specified properties. * @param [properties] Properties to set @@ -16876,6 +16888,9 @@ export namespace google { /** TextDetectionParams enableTextDetectionConfidenceScore */ enableTextDetectionConfidenceScore?: (boolean|null); + + /** TextDetectionParams advancedOcrOptions */ + advancedOcrOptions?: (string[]|null); } /** Represents a TextDetectionParams. */ @@ -16890,6 +16905,9 @@ export namespace google { /** TextDetectionParams enableTextDetectionConfidenceScore. */ public enableTextDetectionConfidenceScore: boolean; + /** TextDetectionParams advancedOcrOptions. */ + public advancedOcrOptions: string[]; + /** * Creates a new TextDetectionParams instance using the specified properties. * @param [properties] Properties to set @@ -22477,6 +22495,9 @@ export namespace google { /** TextDetectionParams enableTextDetectionConfidenceScore */ enableTextDetectionConfidenceScore?: (boolean|null); + + /** TextDetectionParams advancedOcrOptions */ + advancedOcrOptions?: (string[]|null); } /** Represents a TextDetectionParams. */ @@ -22491,6 +22512,9 @@ export namespace google { /** TextDetectionParams enableTextDetectionConfidenceScore. */ public enableTextDetectionConfidenceScore: boolean; + /** TextDetectionParams advancedOcrOptions. */ + public advancedOcrOptions: string[]; + /** * Creates a new TextDetectionParams instance using the specified properties. * @param [properties] Properties to set @@ -32309,6 +32333,9 @@ export namespace google { /** TextDetectionParams enableTextDetectionConfidenceScore */ enableTextDetectionConfidenceScore?: (boolean|null); + + /** TextDetectionParams advancedOcrOptions */ + advancedOcrOptions?: (string[]|null); } /** Represents a TextDetectionParams. */ @@ -32323,6 +32350,9 @@ export namespace google { /** TextDetectionParams enableTextDetectionConfidenceScore. */ public enableTextDetectionConfidenceScore: boolean; + /** TextDetectionParams advancedOcrOptions. */ + public advancedOcrOptions: string[]; + /** * Creates a new TextDetectionParams instance using the specified properties. * @param [properties] Properties to set diff --git a/protos/protos.js b/protos/protos.js index cd3367eb..4968511b 100644 --- a/protos/protos.js +++ b/protos/protos.js @@ -6455,6 +6455,7 @@ * @memberof google.cloud.vision.v1 * @interface ITextDetectionParams * @property {boolean|null} [enableTextDetectionConfidenceScore] TextDetectionParams enableTextDetectionConfidenceScore + * @property {Array.|null} [advancedOcrOptions] TextDetectionParams advancedOcrOptions */ /** @@ -6466,6 +6467,7 @@ * @param {google.cloud.vision.v1.ITextDetectionParams=} [properties] Properties to set */ function TextDetectionParams(properties) { + this.advancedOcrOptions = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -6480,6 +6482,14 @@ */ TextDetectionParams.prototype.enableTextDetectionConfidenceScore = false; + /** + * TextDetectionParams advancedOcrOptions. + * @member {Array.} advancedOcrOptions + * @memberof google.cloud.vision.v1.TextDetectionParams + * @instance + */ + TextDetectionParams.prototype.advancedOcrOptions = $util.emptyArray; + /** * Creates a new TextDetectionParams instance using the specified properties. * @function create @@ -6506,6 +6516,9 @@ writer = $Writer.create(); if (message.enableTextDetectionConfidenceScore != null && Object.hasOwnProperty.call(message, "enableTextDetectionConfidenceScore")) writer.uint32(/* id 9, wireType 0 =*/72).bool(message.enableTextDetectionConfidenceScore); + if (message.advancedOcrOptions != null && message.advancedOcrOptions.length) + for (var i = 0; i < message.advancedOcrOptions.length; ++i) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.advancedOcrOptions[i]); return writer; }; @@ -6543,6 +6556,11 @@ case 9: message.enableTextDetectionConfidenceScore = reader.bool(); break; + case 11: + if (!(message.advancedOcrOptions && message.advancedOcrOptions.length)) + message.advancedOcrOptions = []; + message.advancedOcrOptions.push(reader.string()); + break; default: reader.skipType(tag & 7); break; @@ -6581,6 +6599,13 @@ if (message.enableTextDetectionConfidenceScore != null && message.hasOwnProperty("enableTextDetectionConfidenceScore")) if (typeof message.enableTextDetectionConfidenceScore !== "boolean") return "enableTextDetectionConfidenceScore: boolean expected"; + if (message.advancedOcrOptions != null && message.hasOwnProperty("advancedOcrOptions")) { + if (!Array.isArray(message.advancedOcrOptions)) + return "advancedOcrOptions: array expected"; + for (var i = 0; i < message.advancedOcrOptions.length; ++i) + if (!$util.isString(message.advancedOcrOptions[i])) + return "advancedOcrOptions: string[] expected"; + } return null; }; @@ -6598,6 +6623,13 @@ var message = new $root.google.cloud.vision.v1.TextDetectionParams(); if (object.enableTextDetectionConfidenceScore != null) message.enableTextDetectionConfidenceScore = Boolean(object.enableTextDetectionConfidenceScore); + if (object.advancedOcrOptions) { + if (!Array.isArray(object.advancedOcrOptions)) + throw TypeError(".google.cloud.vision.v1.TextDetectionParams.advancedOcrOptions: array expected"); + message.advancedOcrOptions = []; + for (var i = 0; i < object.advancedOcrOptions.length; ++i) + message.advancedOcrOptions[i] = String(object.advancedOcrOptions[i]); + } return message; }; @@ -6614,10 +6646,17 @@ if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.advancedOcrOptions = []; if (options.defaults) object.enableTextDetectionConfidenceScore = false; if (message.enableTextDetectionConfidenceScore != null && message.hasOwnProperty("enableTextDetectionConfidenceScore")) object.enableTextDetectionConfidenceScore = message.enableTextDetectionConfidenceScore; + if (message.advancedOcrOptions && message.advancedOcrOptions.length) { + object.advancedOcrOptions = []; + for (var j = 0; j < message.advancedOcrOptions.length; ++j) + object.advancedOcrOptions[j] = message.advancedOcrOptions[j]; + } return object; }; @@ -30831,6 +30870,7 @@ * @memberof google.cloud.vision.v1p1beta1 * @interface ITextDetectionParams * @property {boolean|null} [enableTextDetectionConfidenceScore] TextDetectionParams enableTextDetectionConfidenceScore + * @property {Array.|null} [advancedOcrOptions] TextDetectionParams advancedOcrOptions */ /** @@ -30842,6 +30882,7 @@ * @param {google.cloud.vision.v1p1beta1.ITextDetectionParams=} [properties] Properties to set */ function TextDetectionParams(properties) { + this.advancedOcrOptions = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -30856,6 +30897,14 @@ */ TextDetectionParams.prototype.enableTextDetectionConfidenceScore = false; + /** + * TextDetectionParams advancedOcrOptions. + * @member {Array.} advancedOcrOptions + * @memberof google.cloud.vision.v1p1beta1.TextDetectionParams + * @instance + */ + TextDetectionParams.prototype.advancedOcrOptions = $util.emptyArray; + /** * Creates a new TextDetectionParams instance using the specified properties. * @function create @@ -30882,6 +30931,9 @@ writer = $Writer.create(); if (message.enableTextDetectionConfidenceScore != null && Object.hasOwnProperty.call(message, "enableTextDetectionConfidenceScore")) writer.uint32(/* id 9, wireType 0 =*/72).bool(message.enableTextDetectionConfidenceScore); + if (message.advancedOcrOptions != null && message.advancedOcrOptions.length) + for (var i = 0; i < message.advancedOcrOptions.length; ++i) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.advancedOcrOptions[i]); return writer; }; @@ -30919,6 +30971,11 @@ case 9: message.enableTextDetectionConfidenceScore = reader.bool(); break; + case 11: + if (!(message.advancedOcrOptions && message.advancedOcrOptions.length)) + message.advancedOcrOptions = []; + message.advancedOcrOptions.push(reader.string()); + break; default: reader.skipType(tag & 7); break; @@ -30957,6 +31014,13 @@ if (message.enableTextDetectionConfidenceScore != null && message.hasOwnProperty("enableTextDetectionConfidenceScore")) if (typeof message.enableTextDetectionConfidenceScore !== "boolean") return "enableTextDetectionConfidenceScore: boolean expected"; + if (message.advancedOcrOptions != null && message.hasOwnProperty("advancedOcrOptions")) { + if (!Array.isArray(message.advancedOcrOptions)) + return "advancedOcrOptions: array expected"; + for (var i = 0; i < message.advancedOcrOptions.length; ++i) + if (!$util.isString(message.advancedOcrOptions[i])) + return "advancedOcrOptions: string[] expected"; + } return null; }; @@ -30974,6 +31038,13 @@ var message = new $root.google.cloud.vision.v1p1beta1.TextDetectionParams(); if (object.enableTextDetectionConfidenceScore != null) message.enableTextDetectionConfidenceScore = Boolean(object.enableTextDetectionConfidenceScore); + if (object.advancedOcrOptions) { + if (!Array.isArray(object.advancedOcrOptions)) + throw TypeError(".google.cloud.vision.v1p1beta1.TextDetectionParams.advancedOcrOptions: array expected"); + message.advancedOcrOptions = []; + for (var i = 0; i < object.advancedOcrOptions.length; ++i) + message.advancedOcrOptions[i] = String(object.advancedOcrOptions[i]); + } return message; }; @@ -30990,10 +31061,17 @@ if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.advancedOcrOptions = []; if (options.defaults) object.enableTextDetectionConfidenceScore = false; if (message.enableTextDetectionConfidenceScore != null && message.hasOwnProperty("enableTextDetectionConfidenceScore")) object.enableTextDetectionConfidenceScore = message.enableTextDetectionConfidenceScore; + if (message.advancedOcrOptions && message.advancedOcrOptions.length) { + object.advancedOcrOptions = []; + for (var j = 0; j < message.advancedOcrOptions.length; ++j) + object.advancedOcrOptions[j] = message.advancedOcrOptions[j]; + } return object; }; @@ -42415,6 +42493,7 @@ * @memberof google.cloud.vision.v1p2beta1 * @interface ITextDetectionParams * @property {boolean|null} [enableTextDetectionConfidenceScore] TextDetectionParams enableTextDetectionConfidenceScore + * @property {Array.|null} [advancedOcrOptions] TextDetectionParams advancedOcrOptions */ /** @@ -42426,6 +42505,7 @@ * @param {google.cloud.vision.v1p2beta1.ITextDetectionParams=} [properties] Properties to set */ function TextDetectionParams(properties) { + this.advancedOcrOptions = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -42440,6 +42520,14 @@ */ TextDetectionParams.prototype.enableTextDetectionConfidenceScore = false; + /** + * TextDetectionParams advancedOcrOptions. + * @member {Array.} advancedOcrOptions + * @memberof google.cloud.vision.v1p2beta1.TextDetectionParams + * @instance + */ + TextDetectionParams.prototype.advancedOcrOptions = $util.emptyArray; + /** * Creates a new TextDetectionParams instance using the specified properties. * @function create @@ -42466,6 +42554,9 @@ writer = $Writer.create(); if (message.enableTextDetectionConfidenceScore != null && Object.hasOwnProperty.call(message, "enableTextDetectionConfidenceScore")) writer.uint32(/* id 9, wireType 0 =*/72).bool(message.enableTextDetectionConfidenceScore); + if (message.advancedOcrOptions != null && message.advancedOcrOptions.length) + for (var i = 0; i < message.advancedOcrOptions.length; ++i) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.advancedOcrOptions[i]); return writer; }; @@ -42503,6 +42594,11 @@ case 9: message.enableTextDetectionConfidenceScore = reader.bool(); break; + case 11: + if (!(message.advancedOcrOptions && message.advancedOcrOptions.length)) + message.advancedOcrOptions = []; + message.advancedOcrOptions.push(reader.string()); + break; default: reader.skipType(tag & 7); break; @@ -42541,6 +42637,13 @@ if (message.enableTextDetectionConfidenceScore != null && message.hasOwnProperty("enableTextDetectionConfidenceScore")) if (typeof message.enableTextDetectionConfidenceScore !== "boolean") return "enableTextDetectionConfidenceScore: boolean expected"; + if (message.advancedOcrOptions != null && message.hasOwnProperty("advancedOcrOptions")) { + if (!Array.isArray(message.advancedOcrOptions)) + return "advancedOcrOptions: array expected"; + for (var i = 0; i < message.advancedOcrOptions.length; ++i) + if (!$util.isString(message.advancedOcrOptions[i])) + return "advancedOcrOptions: string[] expected"; + } return null; }; @@ -42558,6 +42661,13 @@ var message = new $root.google.cloud.vision.v1p2beta1.TextDetectionParams(); if (object.enableTextDetectionConfidenceScore != null) message.enableTextDetectionConfidenceScore = Boolean(object.enableTextDetectionConfidenceScore); + if (object.advancedOcrOptions) { + if (!Array.isArray(object.advancedOcrOptions)) + throw TypeError(".google.cloud.vision.v1p2beta1.TextDetectionParams.advancedOcrOptions: array expected"); + message.advancedOcrOptions = []; + for (var i = 0; i < object.advancedOcrOptions.length; ++i) + message.advancedOcrOptions[i] = String(object.advancedOcrOptions[i]); + } return message; }; @@ -42574,10 +42684,17 @@ if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.advancedOcrOptions = []; if (options.defaults) object.enableTextDetectionConfidenceScore = false; if (message.enableTextDetectionConfidenceScore != null && message.hasOwnProperty("enableTextDetectionConfidenceScore")) object.enableTextDetectionConfidenceScore = message.enableTextDetectionConfidenceScore; + if (message.advancedOcrOptions && message.advancedOcrOptions.length) { + object.advancedOcrOptions = []; + for (var j = 0; j < message.advancedOcrOptions.length; ++j) + object.advancedOcrOptions[j] = message.advancedOcrOptions[j]; + } return object; }; @@ -56760,6 +56877,7 @@ * @memberof google.cloud.vision.v1p3beta1 * @interface ITextDetectionParams * @property {boolean|null} [enableTextDetectionConfidenceScore] TextDetectionParams enableTextDetectionConfidenceScore + * @property {Array.|null} [advancedOcrOptions] TextDetectionParams advancedOcrOptions */ /** @@ -56771,6 +56889,7 @@ * @param {google.cloud.vision.v1p3beta1.ITextDetectionParams=} [properties] Properties to set */ function TextDetectionParams(properties) { + this.advancedOcrOptions = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -56785,6 +56904,14 @@ */ TextDetectionParams.prototype.enableTextDetectionConfidenceScore = false; + /** + * TextDetectionParams advancedOcrOptions. + * @member {Array.} advancedOcrOptions + * @memberof google.cloud.vision.v1p3beta1.TextDetectionParams + * @instance + */ + TextDetectionParams.prototype.advancedOcrOptions = $util.emptyArray; + /** * Creates a new TextDetectionParams instance using the specified properties. * @function create @@ -56811,6 +56938,9 @@ writer = $Writer.create(); if (message.enableTextDetectionConfidenceScore != null && Object.hasOwnProperty.call(message, "enableTextDetectionConfidenceScore")) writer.uint32(/* id 9, wireType 0 =*/72).bool(message.enableTextDetectionConfidenceScore); + if (message.advancedOcrOptions != null && message.advancedOcrOptions.length) + for (var i = 0; i < message.advancedOcrOptions.length; ++i) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.advancedOcrOptions[i]); return writer; }; @@ -56848,6 +56978,11 @@ case 9: message.enableTextDetectionConfidenceScore = reader.bool(); break; + case 11: + if (!(message.advancedOcrOptions && message.advancedOcrOptions.length)) + message.advancedOcrOptions = []; + message.advancedOcrOptions.push(reader.string()); + break; default: reader.skipType(tag & 7); break; @@ -56886,6 +57021,13 @@ if (message.enableTextDetectionConfidenceScore != null && message.hasOwnProperty("enableTextDetectionConfidenceScore")) if (typeof message.enableTextDetectionConfidenceScore !== "boolean") return "enableTextDetectionConfidenceScore: boolean expected"; + if (message.advancedOcrOptions != null && message.hasOwnProperty("advancedOcrOptions")) { + if (!Array.isArray(message.advancedOcrOptions)) + return "advancedOcrOptions: array expected"; + for (var i = 0; i < message.advancedOcrOptions.length; ++i) + if (!$util.isString(message.advancedOcrOptions[i])) + return "advancedOcrOptions: string[] expected"; + } return null; }; @@ -56903,6 +57045,13 @@ var message = new $root.google.cloud.vision.v1p3beta1.TextDetectionParams(); if (object.enableTextDetectionConfidenceScore != null) message.enableTextDetectionConfidenceScore = Boolean(object.enableTextDetectionConfidenceScore); + if (object.advancedOcrOptions) { + if (!Array.isArray(object.advancedOcrOptions)) + throw TypeError(".google.cloud.vision.v1p3beta1.TextDetectionParams.advancedOcrOptions: array expected"); + message.advancedOcrOptions = []; + for (var i = 0; i < object.advancedOcrOptions.length; ++i) + message.advancedOcrOptions[i] = String(object.advancedOcrOptions[i]); + } return message; }; @@ -56919,10 +57068,17 @@ if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.advancedOcrOptions = []; if (options.defaults) object.enableTextDetectionConfidenceScore = false; if (message.enableTextDetectionConfidenceScore != null && message.hasOwnProperty("enableTextDetectionConfidenceScore")) object.enableTextDetectionConfidenceScore = message.enableTextDetectionConfidenceScore; + if (message.advancedOcrOptions && message.advancedOcrOptions.length) { + object.advancedOcrOptions = []; + for (var j = 0; j < message.advancedOcrOptions.length; ++j) + object.advancedOcrOptions[j] = message.advancedOcrOptions[j]; + } return object; }; @@ -80689,6 +80845,7 @@ * @memberof google.cloud.vision.v1p4beta1 * @interface ITextDetectionParams * @property {boolean|null} [enableTextDetectionConfidenceScore] TextDetectionParams enableTextDetectionConfidenceScore + * @property {Array.|null} [advancedOcrOptions] TextDetectionParams advancedOcrOptions */ /** @@ -80700,6 +80857,7 @@ * @param {google.cloud.vision.v1p4beta1.ITextDetectionParams=} [properties] Properties to set */ function TextDetectionParams(properties) { + this.advancedOcrOptions = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -80714,6 +80872,14 @@ */ TextDetectionParams.prototype.enableTextDetectionConfidenceScore = false; + /** + * TextDetectionParams advancedOcrOptions. + * @member {Array.} advancedOcrOptions + * @memberof google.cloud.vision.v1p4beta1.TextDetectionParams + * @instance + */ + TextDetectionParams.prototype.advancedOcrOptions = $util.emptyArray; + /** * Creates a new TextDetectionParams instance using the specified properties. * @function create @@ -80740,6 +80906,9 @@ writer = $Writer.create(); if (message.enableTextDetectionConfidenceScore != null && Object.hasOwnProperty.call(message, "enableTextDetectionConfidenceScore")) writer.uint32(/* id 9, wireType 0 =*/72).bool(message.enableTextDetectionConfidenceScore); + if (message.advancedOcrOptions != null && message.advancedOcrOptions.length) + for (var i = 0; i < message.advancedOcrOptions.length; ++i) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.advancedOcrOptions[i]); return writer; }; @@ -80777,6 +80946,11 @@ case 9: message.enableTextDetectionConfidenceScore = reader.bool(); break; + case 11: + if (!(message.advancedOcrOptions && message.advancedOcrOptions.length)) + message.advancedOcrOptions = []; + message.advancedOcrOptions.push(reader.string()); + break; default: reader.skipType(tag & 7); break; @@ -80815,6 +80989,13 @@ if (message.enableTextDetectionConfidenceScore != null && message.hasOwnProperty("enableTextDetectionConfidenceScore")) if (typeof message.enableTextDetectionConfidenceScore !== "boolean") return "enableTextDetectionConfidenceScore: boolean expected"; + if (message.advancedOcrOptions != null && message.hasOwnProperty("advancedOcrOptions")) { + if (!Array.isArray(message.advancedOcrOptions)) + return "advancedOcrOptions: array expected"; + for (var i = 0; i < message.advancedOcrOptions.length; ++i) + if (!$util.isString(message.advancedOcrOptions[i])) + return "advancedOcrOptions: string[] expected"; + } return null; }; @@ -80832,6 +81013,13 @@ var message = new $root.google.cloud.vision.v1p4beta1.TextDetectionParams(); if (object.enableTextDetectionConfidenceScore != null) message.enableTextDetectionConfidenceScore = Boolean(object.enableTextDetectionConfidenceScore); + if (object.advancedOcrOptions) { + if (!Array.isArray(object.advancedOcrOptions)) + throw TypeError(".google.cloud.vision.v1p4beta1.TextDetectionParams.advancedOcrOptions: array expected"); + message.advancedOcrOptions = []; + for (var i = 0; i < object.advancedOcrOptions.length; ++i) + message.advancedOcrOptions[i] = String(object.advancedOcrOptions[i]); + } return message; }; @@ -80848,10 +81036,17 @@ if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.advancedOcrOptions = []; if (options.defaults) object.enableTextDetectionConfidenceScore = false; if (message.enableTextDetectionConfidenceScore != null && message.hasOwnProperty("enableTextDetectionConfidenceScore")) object.enableTextDetectionConfidenceScore = message.enableTextDetectionConfidenceScore; + if (message.advancedOcrOptions && message.advancedOcrOptions.length) { + object.advancedOcrOptions = []; + for (var j = 0; j < message.advancedOcrOptions.length; ++j) + object.advancedOcrOptions[j] = message.advancedOcrOptions[j]; + } return object; }; diff --git a/protos/protos.json b/protos/protos.json index ea9bc202..8f2d1b40 100644 --- a/protos/protos.json +++ b/protos/protos.json @@ -622,6 +622,11 @@ "enableTextDetectionConfidenceScore": { "type": "bool", "id": 9 + }, + "advancedOcrOptions": { + "rule": "repeated", + "type": "string", + "id": 11 } } }, @@ -2778,6 +2783,11 @@ "enableTextDetectionConfidenceScore": { "type": "bool", "id": 9 + }, + "advancedOcrOptions": { + "rule": "repeated", + "type": "string", + "id": 11 } } }, @@ -3677,6 +3687,11 @@ "enableTextDetectionConfidenceScore": { "type": "bool", "id": 9 + }, + "advancedOcrOptions": { + "rule": "repeated", + "type": "string", + "id": 11 } } }, @@ -4749,6 +4764,11 @@ "enableTextDetectionConfidenceScore": { "type": "bool", "id": 9 + }, + "advancedOcrOptions": { + "rule": "repeated", + "type": "string", + "id": 11 } } }, @@ -6924,6 +6944,11 @@ "enableTextDetectionConfidenceScore": { "type": "bool", "id": 9 + }, + "advancedOcrOptions": { + "rule": "repeated", + "type": "string", + "id": 11 } } },