Google Cloud Document Ai V1 Client - Class Hints (1.9.0)

Reference documentation and code samples for the Google Cloud Document Ai V1 Client class Hints.

Hints for OCR Engine

Generated from protobuf message google.cloud.documentai.v1.OcrConfig.Hints

Namespace

Google \ Cloud \ DocumentAI \ V1 \ OcrConfig

Methods

__construct

Constructor.

Parameters
NameDescription
data array

Optional. Data for populating the Message object.

↳ language_hints array

List of BCP-47 language codes to use for OCR. In most cases, not specifying it yields the best results since it enables automatic language detection. For languages based on the Latin alphabet, setting hints is not needed. In rare cases, when the language of the text in the image is known, setting a hint will help get better results (although it will be a significant hindrance if the hint is wrong).

getLanguageHints

List of BCP-47 language codes to use for OCR. In most cases, not specifying it yields the best results since it enables automatic language detection. For languages based on the Latin alphabet, setting hints is not needed. In rare cases, when the language of the text in the image is known, setting a hint will help get better results (although it will be a significant hindrance if the hint is wrong).

Returns
TypeDescription
Google\Protobuf\Internal\RepeatedField

setLanguageHints

List of BCP-47 language codes to use for OCR. In most cases, not specifying it yields the best results since it enables automatic language detection. For languages based on the Latin alphabet, setting hints is not needed. In rare cases, when the language of the text in the image is known, setting a hint will help get better results (although it will be a significant hindrance if the hint is wrong).

Parameter
NameDescription
var string[]
Returns
TypeDescription
$this