fix issue

This commit is contained in:
weiweiw 2024-05-08 11:09:25 +08:00
parent 3160231280
commit 51efb77261
1 changed files with 16 additions and 2 deletions

View File

@ -113,7 +113,7 @@ class IdentityCardExtractor(Extractor):
result["name"] = name.group(1).strip()
tempName = result["name"]
if tempName.startswith(""):
result["name"] = text[len(""):]
result["name"] = tempName[len(""):]
# 提取民族
ethnicity = re.search(r"\s*(族|旅)\s*(\S+)", text, re.DOTALL)
@ -382,7 +382,21 @@ class IdentityCardExtractor(Extractor):
# 23
# 公民身份号码
# 430281197011090090"""
# text = """中华人民共和国
# 居民身份证
# 签发机关湘乡市公安局
# 有效期限2016.01.25-2036.01.25
# 名李绍光
# 性别男
# 民族汉
# 出
# 生
# 1983年11月24日
# 住址
# 湖南省湘乡市山枣镇龙泉
# 村峡山口村民组156号
# 公民身份号码
# 43038119831124301X"""
# extractor = IdentityCardExtractor()
# jsonstring = extractor.extract_textbyPaddle(text)
# print(jsonstring)