Jump to top

MLDocumentTextBlock

interface

Represents a block of text.

Properties

boundingBox

</>

Returns the bounding rectangle of the detected text.

boundingBox: MLRectangle;

confidence

</>

The confidence of the recognized text. It only return valid result from cloud recognizers. For on-device text recognition, the confidence is always null.

confidence: null | number;

paragraphs

</>

Gets an Array of MLDocumentTextParagraphs that make up this block.

recognizedBreak

</>

Gets the recognized break - the detected start or end of a structural component.

recognizedLanguages

</>

Gets a list of recognized languages. (Cloud API only. On-Device returns empty array)

recognizedLanguages: string[];

text

</>

Gets the recognized text as a string. Returned in reading order for the language. For Latin, this is top to bottom within a MLTextBlock, and left-to-right within a MLTextLine.

text: string;