添加医院名的分析处理
This commit is contained in:
@@ -173,3 +173,16 @@ def handle_age(string):
|
||||
string = string.split("岁")[0]
|
||||
num = re.sub(r'\D', '', string)
|
||||
return num[-3:]
|
||||
|
||||
|
||||
# 分析医院
|
||||
def parse_hospital(string):
|
||||
result = []
|
||||
if not string:
|
||||
return result
|
||||
|
||||
string_without_brackets = string.replace(")", "").replace(")", "").replace("(", " ").replace("(", " ")
|
||||
string_without_company = string_without_brackets.replace("有限公司", "")
|
||||
simple_chinese_string = string_without_company.replace("醫", "医")
|
||||
result += simple_chinese_string.split(" ")
|
||||
return result
|
||||
|
||||
Reference in New Issue
Block a user