135d5714 by 周伟奇

fix bug

1 parent 40ea31e8
......@@ -431,6 +431,8 @@ class Finder:
repayment_schedule_text_list = []
table = False
page = None
left = 0
right = 0
for pno in self.pdf_info:
for block in self.pdf_info[pno]['blocks']:
if block['type'] != 0:
......@@ -438,6 +440,8 @@ class Finder:
for line in block['lines']:
for span in line['spans']:
bbox, text = span['bbox'], span['text']
if '剩余融资' in text:
right = bbox[2]
if '以上表格中所列序号' in text:
table = False
if table == True:
......@@ -448,10 +452,13 @@ class Finder:
if re.findall("\d+", text):
if len(re.findall("\d+", text)) == 1:
continue
if not left < bbox[0] < right:
continue
repayment_schedule_text_list.append(text)
if '61.' in text:
page = pno
table = True
left = bbox[0]
# print("repayment_schedule_text_list = ", repayment_schedule_text_list)
# repayment_schedule_table = [['序号', '融资租赁成本', '融资租赁费用', '租金', '剩余融资租赁成本']]
repayment_schedule_table = [['序号', '租金']]
......
......@@ -317,7 +317,7 @@ class Comparison:
def se_date_compare(self, input_str, ocr_str, **kwargs):
if kwargs.get('long', False):
if '长期' in ocr_str or '永久' in ocr_str or '***' in ocr_str or '至今' in ocr_str or '年—月—日' in ocr_str or '年 月 日' in ocr_str:
if '长期' in ocr_str or '永久' in ocr_str or '***' in ocr_str or '至今' in ocr_str or '年—月—日' in ocr_str or '年 月 日' in ocr_str or '年月日' in ocr_str:
if kwargs.get('today', False) or input_str in ['2099-12-31', '2099-01-01', '2999-12-31', '2999-01-01']:
return self.RESULT_Y
else:
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!