Reference documentation and code samples for the Google Cloud Document Ai V1 Client class Hints.
Hints for OCR Engine
Generated from protobuf messagegoogle.cloud.documentai.v1.OcrConfig.Hints
Namespace
Google \ Cloud \ DocumentAI \ V1 \ OcrConfig
Methods
__construct
Constructor.
Parameters
Name
Description
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).
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).
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Google Cloud Document Ai V1 Client - Class Hints (2.3.0)\n\nVersion latestkeyboard_arrow_down\n\n- [2.3.0 (latest)](/php/docs/reference/cloud-document-ai/latest/V1.OcrConfig.Hints)\n- [2.2.2](/php/docs/reference/cloud-document-ai/2.2.2/V1.OcrConfig.Hints)\n- [2.1.3](/php/docs/reference/cloud-document-ai/2.1.3/V1.OcrConfig.Hints)\n- [2.0.0](/php/docs/reference/cloud-document-ai/2.0.0/V1.OcrConfig.Hints)\n- [1.14.0](/php/docs/reference/cloud-document-ai/1.14.0/V1.OcrConfig.Hints)\n- [1.13.1](/php/docs/reference/cloud-document-ai/1.13.1/V1.OcrConfig.Hints)\n- [1.12.2](/php/docs/reference/cloud-document-ai/1.12.2/V1.OcrConfig.Hints)\n- [1.9.0](/php/docs/reference/cloud-document-ai/1.9.0/V1.OcrConfig.Hints)\n- [1.8.2](/php/docs/reference/cloud-document-ai/1.8.2/V1.OcrConfig.Hints)\n- [1.7.0](/php/docs/reference/cloud-document-ai/1.7.0/V1.OcrConfig.Hints)\n- [1.6.0](/php/docs/reference/cloud-document-ai/1.6.0/V1.OcrConfig.Hints)\n- [1.5.0](/php/docs/reference/cloud-document-ai/1.5.0/V1.OcrConfig.Hints)\n- [1.4.0](/php/docs/reference/cloud-document-ai/1.4.0/V1.OcrConfig.Hints)\n- [1.3.0](/php/docs/reference/cloud-document-ai/1.3.0/V1.OcrConfig.Hints)\n- [1.2.2](/php/docs/reference/cloud-document-ai/1.2.2/V1.OcrConfig.Hints)\n- [1.1.1](/php/docs/reference/cloud-document-ai/1.1.1/V1.OcrConfig.Hints)\n- [1.0.1](/php/docs/reference/cloud-document-ai/1.0.1/V1.OcrConfig.Hints) \nReference documentation and code samples for the Google Cloud Document Ai V1 Client class Hints.\n\nHints for OCR Engine\n\nGenerated from protobuf message `google.cloud.documentai.v1.OcrConfig.Hints`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ DocumentAI \\\\ V1 \\\\ OcrConfig\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getLanguageHints\n\nList of BCP-47 language codes to use for OCR. In most cases, not\nspecifying it yields the best results since it enables automatic language\ndetection. For languages based on the Latin alphabet, setting hints is\nnot needed. In rare cases, when the language of the text in the\nimage is known, setting a hint will help get better results (although it\nwill be a significant hindrance if the hint is wrong).\n\n### setLanguageHints\n\nList of BCP-47 language codes to use for OCR. In most cases, not\nspecifying it yields the best results since it enables automatic language\ndetection. For languages based on the Latin alphabet, setting hints is\nnot needed. In rare cases, when the language of the text in the\nimage is known, setting a hint will help get better results (although it\nwill be a significant hindrance if the hint is wrong)."]]