This repository was archived by the owner on Apr 11, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -799,11 +799,12 @@ def _generate_table_bbox(self):
799799 self .parse_details ["bbox_searches" ] = []
800800 self .parse_details ["col_searches" ] = []
801801
802- while True :
802+ while textlines : # Continue while there are textlines to process
803803 bbox_body = None
804804 bbox_body , gaps_hv = self ._get_bbox_body (user_provided_bboxes , textlines )
805+
805806 if bbox_body is None :
806- break
807+ break # Exit the loop if no more bbox_body can be generated
807808
808809 tls_in_bbox = textlines_overlapping_bbox (bbox_body , textlines )
809810 cols_boundaries = find_columns_boundaries (tls_in_bbox )
@@ -836,8 +837,13 @@ def _generate_table_bbox(self):
836837
837838 # Update processed textlines
838839 textlines_processed .update (tls_in_bbox )
840+ # Filter out processed textlines
839841 textlines = [tl for tl in textlines if tl not in textlines_processed ]
840842
843+ # Early exit if all textlines have been processed
844+ if not textlines :
845+ break # No more textlines to process, exit the loop
846+
841847 def _get_bbox_body (self , user_provided_bboxes , textlines ):
842848 if user_provided_bboxes is not None :
843849 if len (user_provided_bboxes ) > 0 :
You can’t perform that action at this time.
0 commit comments