简历解析兼容

This commit is contained in:
Àî×ÚÕñ 2022-10-08 15:42:34 +08:00
parent 2f9ef29bf8
commit b2ccffe0d8

View File

@ -385,6 +385,66 @@ def fmt_txt(chk_str):
new_str_list1.append(new_str) new_str_list1.append(new_str)
continue continue
if new_str_list1: if new_str_list1:
if '项目:' in new_str_list1[0]:
for project_str in new_str_list1:
dict_project = {
'name': '',
'time': '',
'comment': '',
'work': '',
'duty': '',
}
time_str = ''
company_name1 = ''
job_name = ''
chk_project_list = project_str.split('\n')
chk_key = ''
for index, str_project in enumerate(chk_project_list):
# 解析时间以及工作经历
if index == 0:
time_name_list = str_project.split(' ')
time_str = time_name_list[0] + time_name_list[1]
for project_str1 in time_name_list[2:]:
if '公司' in project_str1:
company_name1 = project_str1
if '/' in company_name1:
new_chk_company = company_name1.split('/')
company_name1 = new_chk_company[0]
job_name = new_chk_company[1]
continue
job_name = project_str1
continue
if '项目:' in str_project:
dict_project['name'] = str_project.split('')[-1]
continue
if '开发环境' in str_project or '开发工具' in str_project or '开发技术' in str_project:
dict_project['duty'] += re.split('[:|]', str_project)[-1]
chk_key = 'duty'
continue
if '项目描述' in str_project or '功能介绍' in str_project:
dict_project['comment'] += re.split('[:|]', str_project)[-1]
chk_key = 'comment'
continue
if '职责' in str_project or '负责' in str_project:
dict_project['duty'] += re.split('[:|]', str_project)[-1]
chk_key = 'duty'
continue
if chk_key:
dict_project[chk_key] += str_project
continue
dict_project['time'] = time_str
dict_project['work'] = job_name
project_undergo_list.append(dict_project)
# 存在工作公司经历:
if company_name1:
work_dict = {
'company_name': company_name1,
'time': time_str,
'position_name': job_name,
'duty': dict_project['duty'],
}
work_list.append(work_dict)
else:
for project_str in new_str_list1: for project_str in new_str_list1:
project_name_time_str = project_str.split('\n')[0] project_name_time_str = project_str.split('\n')[0]
dict_project = { dict_project = {
@ -700,7 +760,8 @@ def fmt_txt(chk_str):
chk_key = 'duty' chk_key = 'duty'
continue continue
project_undergo_list.append(dict_project1) project_undergo_list.append(dict_project1)
dict_chk['project_undergo'] = [i for i in project_undergo_list if i != {'name': '', 'time': '', 'comment': '', 'work': '', 'duty': ''}] dict_chk['project_undergo'] = [i for i in project_undergo_list if
i != {'name': '', 'time': '', 'comment': '', 'work': '', 'duty': ''}]
# 数字开头 # 数字开头
if work_str2[0].isdigit(): if work_str2[0].isdigit():
@ -2447,4 +2508,4 @@ egreat海尔MeleA20MeleA31LG1154极米杰科亿典等机顶
""" """
fmt_txt(chk_str14) fmt_txt(chk_str3)