简历解析兼容

This commit is contained in:
Àî×ÚÕñ 2022-10-09 15:14:28 +08:00
parent bd8d5d3953
commit 14c6136567

View File

@ -617,6 +617,37 @@ def fmt_txt(chk_str):
index2 = -1
name2 = ''
new_str_list1 = []
if '-至今' in project_undergo2:
for index, i in enumerate(project_list):
if index <= index2:
continue
if not i:
continue
if i.strip().startswith('-'):
if i.strip() == '-':
index2 = index + 2
name3 = project_list[index + 2].split('\n')[-1]
if not name2:
new_str = project_list[index - 2] + project_list[index - 1] + i + project_list[
index + 1] + \
project_list[index + 2].split(name3)[0]
name2 = name3
else:
new_str = name2 + project_list[index - 1] + i + project_list[index + 1] + \
project_list[index + 2]
name2 = name3
new_str_list1.append(new_str)
else:
name3 = i.split('\n')[-1]
if not name2:
index2 = index
new_str = project_list[index - 2] + project_list[index - 1] + i.split(name3)[0]
name2 = name3
else:
new_str = name2 + project_list[index - 1] + i.split(name3)[0]
name2 = name3
new_str_list1.append(new_str)
else:
for index, i in enumerate(project_list):
if index <= index2:
continue
@ -649,6 +680,9 @@ def fmt_txt(chk_str):
name2 = name3
else:
name3 = i.split('\n')[-1]
if (index - 1) >= len(str_2):
new_str = str_2[index - 2] + i.split(name3)[0]
else:
new_str = str_2[index - 2] + str_2[index - 1] + i.split(name3)[0]
name2 = name3
new_str_list1.append(new_str)
@ -675,9 +709,13 @@ def fmt_txt(chk_str):
dict_project['work'] = project_name_time_str2[index + 1].split(' ')[-1]
break
else:
if index + 2 >= len(project_name_time_str2):
dict_project['time'] = (
p_str + project_name_time_str2[index + 1] + project_name_time_str2[
index + 2]).replace('.', '/')
p_str + project_name_time_str2[index + 1]).replace('.', '/')
else:
dict_project['time'] = (p_str + project_name_time_str2[index + 1] +
project_name_time_str2[index + 2]).replace('.',
'/')
dict_project['name'] = project_name_time_str2[index - 1]
if index + 3 <= len(project_name_time_str2):
dict_project['work'] = project_name_time_str2[index + 3]
@ -835,6 +873,8 @@ def fmt_txt(chk_str):
name1 = str_2[index + 2].strip().strip('\n').split('\n')[-1]
if str_2[index + 2].strip().endswith('') or str_2[index + 2].strip().endswith(':'):
name1 = str_2[index + 2].split('\n')[-2]
if not name1:
name1 = str_2[index + 2].split(' ')[0]
new_str = str_2[index - 2] + str_2[index - 1] + i + str_2[index + 1] + \
str_2[index + 2].split(name1)[0]
name = name1
@ -2508,4 +2548,4 @@ egreat海尔MeleA20MeleA31LG1154极米杰科亿典等机顶
"""
fmt_txt(chk_str3)
fmt_txt(chk_str12)