da4982cf by 周伟奇

SE logic modify part2

1 parent 1a89d0da
......@@ -183,6 +183,16 @@ class Comparison:
def se_date_contain_compare(self, input_str, ocr_str_or_list, **kwargs):
return self.RESULT_Y
@staticmethod
def amount_fix(src_str):
replace_char_list = []
for idx in range(len(src_str)):
if src_str[idx].isdigit():
replace_char_list.append(src_str[idx])
elif idx == len(src_str)-3 and src_str[idx] == '.':
replace_char_list.append(src_str[idx])
return ''.join(replace_char_list)
def se_schedule_compare(self, input_str, ocr_str_or_list, **kwargs):
if isinstance(ocr_str_or_list, list):
if len(ocr_str_or_list) > 0:
......@@ -192,7 +202,8 @@ class Comparison:
tmp_str = "{1}{0}{2}".format(
self.SPLIT_STR,
row_list[0].replace('.', ''),
row_list[kwargs.get('value_idx', 1)].replace(',', ''))
# 优化还款计划表页,小数点只存在与还款金额的倒数第三位。
self.amount_fix(row_list[kwargs.get('value_idx', 1)]))
schedule_list.append(tmp_str)
return self.build_res(self.SCHEDULE_SPLIT_STR.join(schedule_list) == input_str)
else:
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!