优化“病区”的处理

This commit is contained in:
2024-08-21 12:48:16 +08:00
parent 2ae43d6e88
commit 0e17f2b9aa
3 changed files with 3 additions and 5 deletions

View File

@@ -106,6 +106,7 @@ def parse_department(string):
string = string.replace(")", "").replace("", "").replace("(", " ").replace("", " ") # 去除括号
string = re.sub(r'[^⺀-鿿 ]', '', string) # 去除非汉字字符,除了空格
string = re.sub(r'[一二三四五六七八九十]', '', string) # 去除中文数字
string = string.replace("病区", "").replace("", "") # 去除常见的无意义词
string = string.replace("", " ") # 分离科室
departments = string.strip().split(" ")
for department in departments: