优化姓名的匹配正则
This commit is contained in:
@@ -126,6 +126,7 @@ def get_mask_layout(image, name, id_card_num):
|
||||
r = f"[{']['.join(re_list)}]"
|
||||
if (name_len & 1) == 1:
|
||||
r += f"|[{']['.join(re_list[:name_offset])}].?[{']['.join(re_list[-name_offset:])}]"
|
||||
r += f"|名[:|:](?=.*[{'|'.join(re_list)}]).{{{name_len}}}"
|
||||
|
||||
for layout in layouts:
|
||||
find_name_by_key = True
|
||||
|
||||
Reference in New Issue
Block a user