Skip to content

Commit

Permalink
Add debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
jayvarner committed Jan 26, 2024
1 parent 3c0d533 commit e5b12a9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions readux_ingest_ecds/services/ocr_services.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,7 @@ def parse_xml_ocr(result):
def add_ocr_annotations(canvas, ocr):
word_order = 1
for word in ocr:
print(f'adding word {word}')
# A quick check to make sure the header row didn't slip through.
if word['x'] == 'x':
continue
Expand All @@ -389,6 +390,7 @@ def add_ocr_annotations(canvas, ocr):
word['content'].isspace()
):
word['content'] = ' '
print(f'creating anno for {word}')
anno = OCR()
anno.canvas = canvas
anno.x = word['x']
Expand All @@ -398,7 +400,9 @@ def add_ocr_annotations(canvas, ocr):
anno.resource_type = anno.OCR
anno.content = word['content']
anno.order = word_order
print(f'saving {word}')
anno.save()
print(f'saved {word}')
word_order += 1

def add_oa_annotations(annotation_list_url):
Expand Down

0 comments on commit e5b12a9

Please sign in to comment.