cd2068d7 by 周伟奇

fix last pno

1 parent 7453129c
......@@ -195,7 +195,9 @@ class Retriever:
pdf_result = dict()
for pno_str, fields_dict in self.target_fields.items():
is_last_pno = False
if pno_str == '-1':
is_last_pno = True
pno_int_list = [int(pno_str) for pno_str in pdf_text_list.keys()]
pno_str = str(max(pno_int_list))
......@@ -248,6 +250,7 @@ class Retriever:
self.position_str: list(coordinates),
}
pdf_result['page_{0}'.format(int(pno_str) + 1)] = page_result
page_key = 'page_12' if is_last_pno else 'page_{0}'.format(int(pno_str) + 1)
pdf_result[page_key] = page_result
return pdf_result
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!