TextBlock

public classTextBlockextendsObject
implementsText

A block of text (think of it as a paragraph) as deemed by the OCR engine.

Public Method Summary

Rect
getBoundingBox()
Returns the TextBlock's axis-aligned bounding box.
List<? extendsText>
getComponents()
Smaller components that comprise this entity, if any.
Point[]
getCornerPoints()
4 corner points in clockwise direction starting with top-left.
String
getLanguage()
Prevailing language in the TextBlock.
String
getValue()
Retrieve the recognized text as a string.

Inherited Method Summary

Public Methods

publicRectgetBoundingBox()

Returns the TextBlock's axis-aligned bounding box.

publicList<? extendsText> getComponents()

Smaller components that comprise this entity, if any. If this entity is an atom, an empty list is returned.TextBlock is at the top of the Text hierarchy.TextBlock containsLine objects, which containsElements. Elements are atoms. We may decide to add character-level objects in later versions.

For example, a client could draw bounding boxes for recognized text in different colors for paragraphs, lines, words, and Alpha bets by repeatedly traversing down the tree with this method.

publicPoint[] getCornerPoints()

4 corner points in clockwise direction starting with top-left. Due to the possible perspective distortions, this is not necessarily a rectangle.

publicStringgetLanguage()

Prevailing language in the TextBlock.

publicStringgetValue()

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