TextFragment

Inheritance: java.lang.Object

public class TextFragment

Represents a part of recognized text (word, symbol, etc), extracted by OCR engine.


Learn more

Constructors

Constructor Description
TextFragment(String text, Rectangle rectangle) Initializes a new instance of the recognised text fragment.

Methods

Method Description
getText() Gets a textual content of the recognised text fragment.
getRectangle() Gets a bounding rectangle of the recognised text fragment.
toString() Returns textual content of the recognised text fragment.

TextFragment(String text, Rectangle rectangle)

public TextFragment(String text, Rectangle rectangle)

Initializes a new instance of the recognised text fragment.

Parameters:

Parameter Type Description
text java.lang.String textual content of the recognised text fragment
rectangle java.awt.Rectangle bounding rectangle of the recognised text fragment

getText()

public final String getText()

Gets a textual content of the recognised text fragment.

Returns: java.lang.String - A textual content of the recognised text fragment.

getRectangle()

public final Rectangle getRectangle()

Gets a bounding rectangle of the recognised text fragment.

Returns: java.awt.Rectangle - A bounding rectangle of the recognised text fragment.

toString()

public String toString()

Returns textual content of the recognised text fragment.

Returns: java.lang.String - textual content of the recognised text fragment