Package com.google.cloud.documentai.v1
Class OcrConfig.Builder
java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessage.Builder<OcrConfig.Builder>
com.google.cloud.documentai.v1.OcrConfig.Builder
- All Implemented Interfaces:
OcrConfigOrBuilder,com.google.protobuf.Message.Builder,com.google.protobuf.MessageLite.Builder,com.google.protobuf.MessageLiteOrBuilder,com.google.protobuf.MessageOrBuilder,Cloneable
- Enclosing class:
- OcrConfig
public static final class OcrConfig.Builder
extends com.google.protobuf.GeneratedMessage.Builder<OcrConfig.Builder>
implements OcrConfigOrBuilder
Config for Document OCR.Protobuf type
google.cloud.documentai.v1.OcrConfig-
Method Summary
Modifier and TypeMethodDescriptionaddAdvancedOcrOptions(String value) A list of advanced OCR options to further fine-tune OCR behavior.addAdvancedOcrOptionsBytes(com.google.protobuf.ByteString value) A list of advanced OCR options to further fine-tune OCR behavior.addAllAdvancedOcrOptions(Iterable<String> values) A list of advanced OCR options to further fine-tune OCR behavior.build()clear()A list of advanced OCR options to further fine-tune OCR behavior.Deprecated.google.cloud.documentai.v1.OcrConfig.compute_style_info is deprecated.Turn off character box detector in OCR engine.Enables intelligent document quality scores after OCR.Enables special handling for PDFs with existing text information.Includes symbol level OCR information if set to true.Hints for the OCR model.Configurations for premium OCR features.getAdvancedOcrOptions(int index) A list of advanced OCR options to further fine-tune OCR behavior.com.google.protobuf.ByteStringgetAdvancedOcrOptionsBytes(int index) A list of advanced OCR options to further fine-tune OCR behavior.intA list of advanced OCR options to further fine-tune OCR behavior.com.google.protobuf.ProtocolStringListA list of advanced OCR options to further fine-tune OCR behavior.booleanDeprecated.google.cloud.documentai.v1.OcrConfig.compute_style_info is deprecated.static final com.google.protobuf.Descriptors.Descriptorcom.google.protobuf.Descriptors.DescriptorbooleanTurn off character box detector in OCR engine.booleanEnables intelligent document quality scores after OCR.booleanEnables special handling for PDFs with existing text information.booleanIncludes symbol level OCR information if set to true.getHints()Hints for the OCR model.Hints for the OCR model.Hints for the OCR model.Configurations for premium OCR features.Configurations for premium OCR features.Configurations for premium OCR features.booleanhasHints()Hints for the OCR model.booleanConfigurations for premium OCR features.protected com.google.protobuf.GeneratedMessage.FieldAccessorTablefinal booleanmergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) mergeFrom(com.google.protobuf.Message other) mergeHints(OcrConfig.Hints value) Hints for the OCR model.Configurations for premium OCR features.setAdvancedOcrOptions(int index, String value) A list of advanced OCR options to further fine-tune OCR behavior.setComputeStyleInfo(boolean value) Deprecated.google.cloud.documentai.v1.OcrConfig.compute_style_info is deprecated.setDisableCharacterBoxesDetection(boolean value) Turn off character box detector in OCR engine.setEnableImageQualityScores(boolean value) Enables intelligent document quality scores after OCR.setEnableNativePdfParsing(boolean value) Enables special handling for PDFs with existing text information.setEnableSymbol(boolean value) Includes symbol level OCR information if set to true.setHints(OcrConfig.Hints value) Hints for the OCR model.setHints(OcrConfig.Hints.Builder builderForValue) Hints for the OCR model.Configurations for premium OCR features.setPremiumFeatures(OcrConfig.PremiumFeatures.Builder builderForValue) Configurations for premium OCR features.Methods inherited from class com.google.protobuf.GeneratedMessage.Builder
addRepeatedField, clearField, clearOneof, clone, getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, getUnknownFieldSetBuilder, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, internalGetMutableMapField, internalGetMutableMapFieldReflection, isClean, markClean, mergeUnknownFields, mergeUnknownLengthDelimitedField, mergeUnknownVarintField, newBuilderForField, onBuilt, onChanged, parseUnknownField, setField, setRepeatedField, setUnknownFields, setUnknownFieldSetBuilder, setUnknownFieldsProto3Methods inherited from class com.google.protobuf.AbstractMessage.Builder
findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toStringMethods inherited from class com.google.protobuf.AbstractMessageLite.Builder
addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, newUninitializedMessageExceptionMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.google.protobuf.Message.Builder
mergeDelimitedFrom, mergeDelimitedFromMethods inherited from interface com.google.protobuf.MessageLite.Builder
mergeFromMethods inherited from interface com.google.protobuf.MessageOrBuilder
findInitializationErrors, getAllFields, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
-
Method Details
-
getDescriptor
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() -
internalGetFieldAccessorTable
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()- Specified by:
internalGetFieldAccessorTablein classcom.google.protobuf.GeneratedMessage.Builder<OcrConfig.Builder>
-
clear
- Specified by:
clearin interfacecom.google.protobuf.Message.Builder- Specified by:
clearin interfacecom.google.protobuf.MessageLite.Builder- Overrides:
clearin classcom.google.protobuf.GeneratedMessage.Builder<OcrConfig.Builder>
-
getDescriptorForType
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()- Specified by:
getDescriptorForTypein interfacecom.google.protobuf.Message.Builder- Specified by:
getDescriptorForTypein interfacecom.google.protobuf.MessageOrBuilder- Overrides:
getDescriptorForTypein classcom.google.protobuf.GeneratedMessage.Builder<OcrConfig.Builder>
-
getDefaultInstanceForType
- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageLiteOrBuilder- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageOrBuilder
-
build
- Specified by:
buildin interfacecom.google.protobuf.Message.Builder- Specified by:
buildin interfacecom.google.protobuf.MessageLite.Builder
-
buildPartial
- Specified by:
buildPartialin interfacecom.google.protobuf.Message.Builder- Specified by:
buildPartialin interfacecom.google.protobuf.MessageLite.Builder
-
mergeFrom
- Specified by:
mergeFromin interfacecom.google.protobuf.Message.Builder- Overrides:
mergeFromin classcom.google.protobuf.AbstractMessage.Builder<OcrConfig.Builder>
-
mergeFrom
-
isInitialized
public final boolean isInitialized()- Specified by:
isInitializedin interfacecom.google.protobuf.MessageLiteOrBuilder- Overrides:
isInitializedin classcom.google.protobuf.GeneratedMessage.Builder<OcrConfig.Builder>
-
mergeFrom
public OcrConfig.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Specified by:
mergeFromin interfacecom.google.protobuf.Message.Builder- Specified by:
mergeFromin interfacecom.google.protobuf.MessageLite.Builder- Overrides:
mergeFromin classcom.google.protobuf.AbstractMessage.Builder<OcrConfig.Builder>- Throws:
IOException
-
hasHints
public boolean hasHints()Hints for the OCR model.
.google.cloud.documentai.v1.OcrConfig.Hints hints = 2;- Specified by:
hasHintsin interfaceOcrConfigOrBuilder- Returns:
- Whether the hints field is set.
-
getHints
Hints for the OCR model.
.google.cloud.documentai.v1.OcrConfig.Hints hints = 2;- Specified by:
getHintsin interfaceOcrConfigOrBuilder- Returns:
- The hints.
-
setHints
Hints for the OCR model.
.google.cloud.documentai.v1.OcrConfig.Hints hints = 2; -
setHints
Hints for the OCR model.
.google.cloud.documentai.v1.OcrConfig.Hints hints = 2; -
mergeHints
Hints for the OCR model.
.google.cloud.documentai.v1.OcrConfig.Hints hints = 2; -
clearHints
Hints for the OCR model.
.google.cloud.documentai.v1.OcrConfig.Hints hints = 2; -
getHintsBuilder
Hints for the OCR model.
.google.cloud.documentai.v1.OcrConfig.Hints hints = 2; -
getHintsOrBuilder
Hints for the OCR model.
.google.cloud.documentai.v1.OcrConfig.Hints hints = 2;- Specified by:
getHintsOrBuilderin interfaceOcrConfigOrBuilder
-
getEnableNativePdfParsing
public boolean getEnableNativePdfParsing()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;- Specified by:
getEnableNativePdfParsingin interfaceOcrConfigOrBuilder- Returns:
- The enableNativePdfParsing.
-
setEnableNativePdfParsing
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;- Parameters:
value- The enableNativePdfParsing to set.- Returns:
- This builder for chaining.
-
clearEnableNativePdfParsing
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;- Returns:
- This builder for chaining.
-
getEnableImageQualityScores
public boolean getEnableImageQualityScores()Enables intelligent document quality scores after OCR. Can help with diagnosing why OCR responses are of poor quality for a given input. Adds additional latency comparable to regular OCR to the process call.
bool enable_image_quality_scores = 4;- Specified by:
getEnableImageQualityScoresin interfaceOcrConfigOrBuilder- Returns:
- The enableImageQualityScores.
-
setEnableImageQualityScores
Enables intelligent document quality scores after OCR. Can help with diagnosing why OCR responses are of poor quality for a given input. Adds additional latency comparable to regular OCR to the process call.
bool enable_image_quality_scores = 4;- Parameters:
value- The enableImageQualityScores to set.- Returns:
- This builder for chaining.
-
clearEnableImageQualityScores
Enables intelligent document quality scores after OCR. Can help with diagnosing why OCR responses are of poor quality for a given input. Adds additional latency comparable to regular OCR to the process call.
bool enable_image_quality_scores = 4;- Returns:
- This builder for chaining.
-
getAdvancedOcrOptionsList
public com.google.protobuf.ProtocolStringList getAdvancedOcrOptionsList()A list of advanced OCR options to further fine-tune OCR behavior. Current valid values are: - `legacy_layout`: a heuristics layout detection algorithm, which serves as an alternative to the current ML-based layout detection algorithm. Customers can choose the best suitable layout algorithm based on their situation.
repeated string advanced_ocr_options = 5;- Specified by:
getAdvancedOcrOptionsListin interfaceOcrConfigOrBuilder- Returns:
- A list containing the advancedOcrOptions.
-
getAdvancedOcrOptionsCount
public int getAdvancedOcrOptionsCount()A list of advanced OCR options to further fine-tune OCR behavior. Current valid values are: - `legacy_layout`: a heuristics layout detection algorithm, which serves as an alternative to the current ML-based layout detection algorithm. Customers can choose the best suitable layout algorithm based on their situation.
repeated string advanced_ocr_options = 5;- Specified by:
getAdvancedOcrOptionsCountin interfaceOcrConfigOrBuilder- Returns:
- The count of advancedOcrOptions.
-
getAdvancedOcrOptions
A list of advanced OCR options to further fine-tune OCR behavior. Current valid values are: - `legacy_layout`: a heuristics layout detection algorithm, which serves as an alternative to the current ML-based layout detection algorithm. Customers can choose the best suitable layout algorithm based on their situation.
repeated string advanced_ocr_options = 5;- Specified by:
getAdvancedOcrOptionsin interfaceOcrConfigOrBuilder- Parameters:
index- The index of the element to return.- Returns:
- The advancedOcrOptions at the given index.
-
getAdvancedOcrOptionsBytes
public com.google.protobuf.ByteString getAdvancedOcrOptionsBytes(int index) A list of advanced OCR options to further fine-tune OCR behavior. Current valid values are: - `legacy_layout`: a heuristics layout detection algorithm, which serves as an alternative to the current ML-based layout detection algorithm. Customers can choose the best suitable layout algorithm based on their situation.
repeated string advanced_ocr_options = 5;- Specified by:
getAdvancedOcrOptionsBytesin interfaceOcrConfigOrBuilder- Parameters:
index- The index of the value to return.- Returns:
- The bytes of the advancedOcrOptions at the given index.
-
setAdvancedOcrOptions
A list of advanced OCR options to further fine-tune OCR behavior. Current valid values are: - `legacy_layout`: a heuristics layout detection algorithm, which serves as an alternative to the current ML-based layout detection algorithm. Customers can choose the best suitable layout algorithm based on their situation.
repeated string advanced_ocr_options = 5;- Parameters:
index- The index to set the value at.value- The advancedOcrOptions to set.- Returns:
- This builder for chaining.
-
addAdvancedOcrOptions
A list of advanced OCR options to further fine-tune OCR behavior. Current valid values are: - `legacy_layout`: a heuristics layout detection algorithm, which serves as an alternative to the current ML-based layout detection algorithm. Customers can choose the best suitable layout algorithm based on their situation.
repeated string advanced_ocr_options = 5;- Parameters:
value- The advancedOcrOptions to add.- Returns:
- This builder for chaining.
-
addAllAdvancedOcrOptions
A list of advanced OCR options to further fine-tune OCR behavior. Current valid values are: - `legacy_layout`: a heuristics layout detection algorithm, which serves as an alternative to the current ML-based layout detection algorithm. Customers can choose the best suitable layout algorithm based on their situation.
repeated string advanced_ocr_options = 5;- Parameters:
values- The advancedOcrOptions to add.- Returns:
- This builder for chaining.
-
clearAdvancedOcrOptions
A list of advanced OCR options to further fine-tune OCR behavior. Current valid values are: - `legacy_layout`: a heuristics layout detection algorithm, which serves as an alternative to the current ML-based layout detection algorithm. Customers can choose the best suitable layout algorithm based on their situation.
repeated string advanced_ocr_options = 5;- Returns:
- This builder for chaining.
-
addAdvancedOcrOptionsBytes
A list of advanced OCR options to further fine-tune OCR behavior. Current valid values are: - `legacy_layout`: a heuristics layout detection algorithm, which serves as an alternative to the current ML-based layout detection algorithm. Customers can choose the best suitable layout algorithm based on their situation.
repeated string advanced_ocr_options = 5;- Parameters:
value- The bytes of the advancedOcrOptions to add.- Returns:
- This builder for chaining.
-
getEnableSymbol
public boolean getEnableSymbol()Includes symbol level OCR information if set to true.
bool enable_symbol = 6;- Specified by:
getEnableSymbolin interfaceOcrConfigOrBuilder- Returns:
- The enableSymbol.
-
setEnableSymbol
Includes symbol level OCR information if set to true.
bool enable_symbol = 6;- Parameters:
value- The enableSymbol to set.- Returns:
- This builder for chaining.
-
clearEnableSymbol
Includes symbol level OCR information if set to true.
bool enable_symbol = 6;- Returns:
- This builder for chaining.
-
getComputeStyleInfo
Deprecated.google.cloud.documentai.v1.OcrConfig.compute_style_info is deprecated. See google/cloud/documentai/v1/document_io.proto;l=166Turn on font identification model and return font style information. Deprecated, use [PremiumFeatures.compute_style_info][google.cloud.documentai.v1.OcrConfig.PremiumFeatures.compute_style_info] instead.
bool compute_style_info = 8 [deprecated = true];- Specified by:
getComputeStyleInfoin interfaceOcrConfigOrBuilder- Returns:
- The computeStyleInfo.
-
setComputeStyleInfo
Deprecated.google.cloud.documentai.v1.OcrConfig.compute_style_info is deprecated. See google/cloud/documentai/v1/document_io.proto;l=166Turn on font identification model and return font style information. Deprecated, use [PremiumFeatures.compute_style_info][google.cloud.documentai.v1.OcrConfig.PremiumFeatures.compute_style_info] instead.
bool compute_style_info = 8 [deprecated = true];- Parameters:
value- The computeStyleInfo to set.- Returns:
- This builder for chaining.
-
clearComputeStyleInfo
Deprecated.google.cloud.documentai.v1.OcrConfig.compute_style_info is deprecated. See google/cloud/documentai/v1/document_io.proto;l=166Turn on font identification model and return font style information. Deprecated, use [PremiumFeatures.compute_style_info][google.cloud.documentai.v1.OcrConfig.PremiumFeatures.compute_style_info] instead.
bool compute_style_info = 8 [deprecated = true];- Returns:
- This builder for chaining.
-
getDisableCharacterBoxesDetection
public boolean getDisableCharacterBoxesDetection()Turn off character box detector in OCR engine. Character box detection is enabled by default in OCR 2.0 (and later) processors.
bool disable_character_boxes_detection = 10;- Specified by:
getDisableCharacterBoxesDetectionin interfaceOcrConfigOrBuilder- Returns:
- The disableCharacterBoxesDetection.
-
setDisableCharacterBoxesDetection
Turn off character box detector in OCR engine. Character box detection is enabled by default in OCR 2.0 (and later) processors.
bool disable_character_boxes_detection = 10;- Parameters:
value- The disableCharacterBoxesDetection to set.- Returns:
- This builder for chaining.
-
clearDisableCharacterBoxesDetection
Turn off character box detector in OCR engine. Character box detection is enabled by default in OCR 2.0 (and later) processors.
bool disable_character_boxes_detection = 10;- Returns:
- This builder for chaining.
-
hasPremiumFeatures
public boolean hasPremiumFeatures()Configurations for premium OCR features.
.google.cloud.documentai.v1.OcrConfig.PremiumFeatures premium_features = 11;- Specified by:
hasPremiumFeaturesin interfaceOcrConfigOrBuilder- Returns:
- Whether the premiumFeatures field is set.
-
getPremiumFeatures
Configurations for premium OCR features.
.google.cloud.documentai.v1.OcrConfig.PremiumFeatures premium_features = 11;- Specified by:
getPremiumFeaturesin interfaceOcrConfigOrBuilder- Returns:
- The premiumFeatures.
-
setPremiumFeatures
Configurations for premium OCR features.
.google.cloud.documentai.v1.OcrConfig.PremiumFeatures premium_features = 11; -
setPremiumFeatures
Configurations for premium OCR features.
.google.cloud.documentai.v1.OcrConfig.PremiumFeatures premium_features = 11; -
mergePremiumFeatures
Configurations for premium OCR features.
.google.cloud.documentai.v1.OcrConfig.PremiumFeatures premium_features = 11; -
clearPremiumFeatures
Configurations for premium OCR features.
.google.cloud.documentai.v1.OcrConfig.PremiumFeatures premium_features = 11; -
getPremiumFeaturesBuilder
Configurations for premium OCR features.
.google.cloud.documentai.v1.OcrConfig.PremiumFeatures premium_features = 11; -
getPremiumFeaturesOrBuilder
Configurations for premium OCR features.
.google.cloud.documentai.v1.OcrConfig.PremiumFeatures premium_features = 11;- Specified by:
getPremiumFeaturesOrBuilderin interfaceOcrConfigOrBuilder
-