diff --git a/camelot/parsers/lattice.py b/camelot/parsers/lattice.py index 8a85d1d..da3524f 100644 --- a/camelot/parsers/lattice.py +++ b/camelot/parsers/lattice.py @@ -309,7 +309,9 @@ class Lattice(BaseParser): table = table.set_span() pos_errors = [] - for direction in self.t_bbox: + # TODO: have a single list in place of two directional ones? + # sorted on x-coordinate based on reading order i.e. LTR or RTL + for direction in ['vertical', 'horizontal']: for t in self.t_bbox[direction]: indices, error = get_table_index( table, t, direction, split_text=self.split_text, diff --git a/camelot/parsers/stream.py b/camelot/parsers/stream.py index eab8276..4bf482d 100644 --- a/camelot/parsers/stream.py +++ b/camelot/parsers/stream.py @@ -351,8 +351,11 @@ class Stream(BaseParser): def _generate_table(self, table_idx, cols, rows, **kwargs): table = Table(cols, rows) table = table.set_all_edges() + pos_errors = [] - for direction in self.t_bbox: + # TODO: have a single list in place of two directional ones? + # sorted on x-coordinate based on reading order i.e. LTR or RTL + for direction in ['vertical', 'horizontal']: for t in self.t_bbox[direction]: indices, error = get_table_index( table, t, direction, split_text=self.split_text,