From e5b12a9827246d18705be5f3f4ce685247d81ba6 Mon Sep 17 00:00:00 2001 From: Jay Varner Date: Fri, 26 Jan 2024 14:24:20 -0500 Subject: [PATCH] Add debugging --- readux_ingest_ecds/services/ocr_services.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/readux_ingest_ecds/services/ocr_services.py b/readux_ingest_ecds/services/ocr_services.py index 4483867..b7de72e 100644 --- a/readux_ingest_ecds/services/ocr_services.py +++ b/readux_ingest_ecds/services/ocr_services.py @@ -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 @@ -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'] @@ -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):