Fix comments

This commit is contained in:
Vinayak Mehta
2018-11-23 02:51:22 +05:30
parent 9b67b271e4
commit a1e1fd781d
2 changed files with 14 additions and 11 deletions
+4 -4
View File
@@ -247,10 +247,10 @@ class Stream(BaseParser):
" should be equal")
def _nurminen_table_detection(self, textlines):
# an general heuristic implementation of the table detection
# a general heuristic implementation of the table detection
# algorithm described by Anssi Nurminen's master's thesis:
# https://dspace.cc.tut.fi/dpub/bitstream/handle/123456789/21520/Nurminen.pdf?sequence=3
# assumes that tables vertically separated by some distance
# assumes that tables are situated relatively apart vertically
# TODO: add support for arabic text #141
# sort textlines in reading order
@@ -263,9 +263,9 @@ class Stream(BaseParser):
textedges.generate(text_grouped)
# select relevant edges
relevant_textedges = textedges.get_relevant()
# guess table areas using relevant edges
# guess table areas using textlines and relevant edges
table_bbox = textedges.get_table_areas(textlines, relevant_textedges)
# treat whole page as table if not table areas found
# treat whole page as table area if no table areas found
if not len(table_bbox):
table_bbox = {(0, 0, self.pdf_width, self.pdf_height): None}