Fix #105
parent
40217bea46
commit
33cea45346
|
|
@ -273,8 +273,8 @@ class Lattice(BaseParser):
|
||||||
t_bbox['vertical'] = text_in_bbox(tk, self.vertical_text)
|
t_bbox['vertical'] = text_in_bbox(tk, self.vertical_text)
|
||||||
self.t_bbox = t_bbox
|
self.t_bbox = t_bbox
|
||||||
|
|
||||||
for direction in t_bbox:
|
for direction in self.t_bbox:
|
||||||
t_bbox[direction].sort(key=lambda x: (-x.y0, x.x0))
|
self.t_bbox[direction].sort(key=lambda x: (x.x0, -x.y0))
|
||||||
|
|
||||||
cols, rows = zip(*self.table_bbox[tk])
|
cols, rows = zip(*self.table_bbox[tk])
|
||||||
cols, rows = list(cols), list(rows)
|
cols, rows = list(cols), list(rows)
|
||||||
|
|
|
||||||
|
|
@ -296,7 +296,7 @@ class Stream(BaseParser):
|
||||||
self.t_bbox = t_bbox
|
self.t_bbox = t_bbox
|
||||||
|
|
||||||
for direction in self.t_bbox:
|
for direction in self.t_bbox:
|
||||||
self.t_bbox[direction].sort(key=lambda x: (-x.y0, x.x0))
|
self.t_bbox[direction].sort(key=lambda x: (x.x0, -x.y0))
|
||||||
|
|
||||||
text_x_min, text_y_min, text_x_max, text_y_max = self._text_bbox(self.t_bbox)
|
text_x_min, text_y_min, text_x_max, text_y_max = self._text_bbox(self.t_bbox)
|
||||||
rows_grouped = self._group_rows(self.t_bbox['horizontal'], row_close_tol=self.row_close_tol)
|
rows_grouped = self._group_rows(self.t_bbox['horizontal'], row_close_tol=self.row_close_tol)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue