Text
Stay organized with collections
Save and categorize content based on your preferences.
Page Summary
-
Text is a hierarchical representation of texts.
-
Text contains a list of TextBlocks, which contain a list of Lines, which are composed of a list of Elements.
-
TextBlocks represent blocks of text, Lines represent lines of text, Elements represent space-separated segments, and Symbols represent single characters.
-
The
getText()method retrieves all recognized text as a single string, andgetTextBlocks()retrieves a list of TextBlocks.
A hierarchical representation of texts.
A Text contains a list
of Text.TextBlock ,
and a Text.TextBlock
contains a list of Text.Line which
is composed of a list of Text.Element .
Nested Class Summary
Text.Element .
Public Method Summary
Text.TextBlock ,
which is a block of text and can be further decomposed to a list of
Text.Line .
Inherited Method Summary
Public Methods
public String getText ()
Retrieves all the recognized text in the image. It concatenates text strings from
underlying Text.TextBlock s
separated by '\n'.
Returns an empty string if nothing is found.
public List<Text.TextBlock> getTextBlocks ()
Gets an unmodifiable list of Text.TextBlock ,
which is a block of text and can be further decomposed to a list of Text.Line .
The recognized text is in reading order for the language. For Latin, this is top to
bottom within a Text.TextBlock ,
and left-to-right within a Text.Line .
Returns an empty list if nothing is found.