mirror of
https://github.com/mikegerber/ocrd_calamari.git
synced 2025-06-09 11:49:53 +02:00
🚧 Add future TODOs
This commit is contained in:
parent
3149e1d9e0
commit
909632493b
1 changed files with 2 additions and 0 deletions
|
@ -116,6 +116,7 @@ class CalamariRecognize(Processor):
|
||||||
word_no = 0
|
word_no = 0
|
||||||
i = 0
|
i = 0
|
||||||
for word_text in uniseg.wordbreak.words(prediction.sentence):
|
for word_text in uniseg.wordbreak.words(prediction.sentence):
|
||||||
|
# XXX Re-use word segmentation from dinglehopper, i.e. support private use characters
|
||||||
word_length = len(word_text)
|
word_length = len(word_text)
|
||||||
do_not_include = all(unwanted(c) for c in word_text)
|
do_not_include = all(unwanted(c) for c in word_text)
|
||||||
|
|
||||||
|
@ -126,6 +127,7 @@ class CalamariRecognize(Processor):
|
||||||
|
|
||||||
polygon = polygon_from_x0y0x1y1([word_start, 0, word_end, line_image.height])
|
polygon = polygon_from_x0y0x1y1([word_start, 0, word_end, line_image.height])
|
||||||
points = points_from_polygon(coordinates_for_segment(polygon, None, line_coords))
|
points = points_from_polygon(coordinates_for_segment(polygon, None, line_coords))
|
||||||
|
# XXX Crop to line polygon?
|
||||||
|
|
||||||
word = WordType(id='%s_word%04d' % (line.id, word_no), Coords=CoordsType(points))
|
word = WordType(id='%s_word%04d' % (line.id, word_no), Coords=CoordsType(points))
|
||||||
word.add_TextEquiv(TextEquivType(Unicode=word_text))
|
word.add_TextEquiv(TextEquivType(Unicode=word_text))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue