Yaz Hobooti commited on
Commit
e4d5933
·
1 Parent(s): 204147c

Fix spell check bottom exclusion: Add 115mm exclusion to fallback spell check

Browse files
Files changed (1) hide show
  1. app.py +13 -2
app.py CHANGED
@@ -709,13 +709,24 @@ def find_misspell_boxes_from_text(
709
 
710
  if misspelled_words:
711
  # Create a placeholder box for the page
712
- boxes.append(Box(
713
  y1=page_num * 1000,
714
  x1=0,
715
  y2=(page_num + 1) * 1000,
716
  x2=800,
717
  area=800 * 1000
718
- ))
 
 
 
 
 
 
 
 
 
 
 
719
 
720
  return boxes
721
 
 
709
 
710
  if misspelled_words:
711
  # Create a placeholder box for the page
712
+ placeholder_box = Box(
713
  y1=page_num * 1000,
714
  x1=0,
715
  y2=(page_num + 1) * 1000,
716
  x2=800,
717
  area=800 * 1000
718
+ )
719
+
720
+ # Skip if the placeholder box is in the excluded bottom area
721
+ if image_size:
722
+ img_height = image_size[1]
723
+ if _is_in_excluded_bottom_area(placeholder_box, img_height):
724
+ continue
725
+ else:
726
+ if _is_in_excluded_bottom_area(placeholder_box, 1000):
727
+ continue
728
+
729
+ boxes.append(placeholder_box)
730
 
731
  return boxes
732