Last modified: February 13, 2012
Contents
In module gamera.toolkits.ocr.classes
The Textline object stores information about a text line in its following properties:
- bbox
- A Rect object representing the bounding box of the text line.
- glyphs
- A list of Cc objects, each representing a character in the line.
- words
- A nested list of Cc objects, where each sublist represents the characters of a single word.
Signature:
init (bbox, glyphs=None)
with
- bbox:
- Rect object representing position and size of the text line
- glyphs:
- A list of Cc objects representing the characters in the text line
Adds the given glyph to the Textline. Signature:
add_glyph (glyph, extend=True)
When extend is True, the text line bounding box bbox is extended by the glyph's bounding box.
Adds the given glyphs to the Textline. Signature:
add_glyphs (glyphs, extend=True)
When extend is True, the text line bounding box bbox is extended by the union of the glyphs' bounding boxes.
Sorts the characters in Textline.glyphs from left to right.