pull/2/head
Vinayak Mehta 2018-12-13 00:45:22 +05:30
parent 40217bea46
commit 33cea45346
2 changed files with 3 additions and 3 deletions

View File

@ -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)

View File

@ -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)