正则解析
This commit is contained in:
parent
6d61867b9d
commit
c90b3f14f1
@ -323,10 +323,10 @@ def fmt_txt(chk_str):
|
|||||||
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 = {
|
||||||
'company_name': '',
|
'name': '',
|
||||||
'time': '',
|
'time': '',
|
||||||
'comment': '',
|
'comment': '',
|
||||||
'position_name': '',
|
'work': '',
|
||||||
'duty': '',
|
'duty': '',
|
||||||
}
|
}
|
||||||
project_name_time_str2 = re.split('([0-9]{4}[/|.][0-9]{1,2})', project_name_time_str)
|
project_name_time_str2 = re.split('([0-9]{4}[/|.][0-9]{1,2})', project_name_time_str)
|
||||||
@ -337,7 +337,7 @@ def fmt_txt(chk_str):
|
|||||||
if p_str[0].isdigit():
|
if p_str[0].isdigit():
|
||||||
dict_project['time'] = p_str + project_name_time_str2[index + 1] + \
|
dict_project['time'] = p_str + project_name_time_str2[index + 1] + \
|
||||||
project_name_time_str2[index + 2]
|
project_name_time_str2[index + 2]
|
||||||
dict_project['company_name'] = project_name_time_str2[index + 3]
|
dict_project['name'] = project_name_time_str2[index + 3]
|
||||||
break
|
break
|
||||||
project_chk_str2 = project_str.split(project_name_time_str)[-1]
|
project_chk_str2 = project_str.split(project_name_time_str)[-1]
|
||||||
project_chk_str2_list = re.split('(:|:)', project_chk_str2)
|
project_chk_str2_list = re.split('(:|:)', project_chk_str2)
|
||||||
@ -363,7 +363,7 @@ def fmt_txt(chk_str):
|
|||||||
if new_p_chk_list:
|
if new_p_chk_list:
|
||||||
for p_str_true in new_p_chk_list:
|
for p_str_true in new_p_chk_list:
|
||||||
if '开发环境' in p_str_true or '开发工具' in p_str_true or '开发技术' in p_str_true or '模块' in p_str_true:
|
if '开发环境' in p_str_true or '开发工具' in p_str_true or '开发技术' in p_str_true or '模块' in p_str_true:
|
||||||
dict_project['position_name'] += re.split('[:|:]', p_str_true)[-1]
|
dict_project['work'] += re.split('[:|:]', p_str_true)[-1]
|
||||||
continue
|
continue
|
||||||
if '项目描述' in p_str_true or '功能介绍' in p_str_true:
|
if '项目描述' in p_str_true or '功能介绍' in p_str_true:
|
||||||
dict_project['comment'] += re.split('[:|:]', p_str_true)[-1]
|
dict_project['comment'] += re.split('[:|:]', p_str_true)[-1]
|
||||||
@ -376,10 +376,10 @@ def fmt_txt(chk_str):
|
|||||||
else:
|
else:
|
||||||
if project_undergo2.startswith(':') or project_undergo2.startswith(':'):
|
if project_undergo2.startswith(':') or project_undergo2.startswith(':'):
|
||||||
dict_project = {
|
dict_project = {
|
||||||
'company_name': '',
|
'name': '',
|
||||||
'time': '',
|
'time': '',
|
||||||
'comment': '',
|
'comment': '',
|
||||||
'position_name': '',
|
'work': '',
|
||||||
'duty': '',
|
'duty': '',
|
||||||
}
|
}
|
||||||
new_str_list1 = []
|
new_str_list1 = []
|
||||||
@ -420,7 +420,7 @@ def fmt_txt(chk_str):
|
|||||||
dict_project['name'] = re.split('[:|:]', new_p_chk_list[0])[-1]
|
dict_project['name'] = re.split('[:|:]', new_p_chk_list[0])[-1]
|
||||||
for p_str_true in new_p_chk_list:
|
for p_str_true in new_p_chk_list:
|
||||||
if '开发环境' in p_str_true or '开发工具' in p_str_true or '开发技术' in p_str_true or '模块' in p_str_true:
|
if '开发环境' in p_str_true or '开发工具' in p_str_true or '开发技术' in p_str_true or '模块' in p_str_true:
|
||||||
dict_project['position_name'] += re.split('[:|:]', p_str_true)[-1]
|
dict_project['work'] += re.split('[:|:]', p_str_true)[-1]
|
||||||
continue
|
continue
|
||||||
if '项目描述' in p_str_true or '功能介绍' in p_str_true:
|
if '项目描述' in p_str_true or '功能介绍' in p_str_true:
|
||||||
dict_project['comment'] += re.split('[:|:]', p_str_true)[-1]
|
dict_project['comment'] += re.split('[:|:]', p_str_true)[-1]
|
||||||
@ -472,10 +472,10 @@ def fmt_txt(chk_str):
|
|||||||
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 = {
|
||||||
'company_name': '',
|
'name': '',
|
||||||
'time': '',
|
'time': '',
|
||||||
'comment': '',
|
'comment': '',
|
||||||
'position_name': '',
|
'work': '',
|
||||||
'duty': '',
|
'duty': '',
|
||||||
}
|
}
|
||||||
project_name_time_str2 = re.split('([0-9]{4}[/|.][0-9]{1,2})', project_name_time_str)
|
project_name_time_str2 = re.split('([0-9]{4}[/|.][0-9]{1,2})', project_name_time_str)
|
||||||
@ -486,7 +486,7 @@ def fmt_txt(chk_str):
|
|||||||
if p_str[0].isdigit():
|
if p_str[0].isdigit():
|
||||||
dict_project['time'] = p_str + project_name_time_str2[index + 1] + \
|
dict_project['time'] = p_str + project_name_time_str2[index + 1] + \
|
||||||
project_name_time_str2[index + 2]
|
project_name_time_str2[index + 2]
|
||||||
dict_project['company_name'] = project_name_time_str2[index - 1]
|
dict_project['name'] = project_name_time_str2[index - 1]
|
||||||
break
|
break
|
||||||
project_chk_str2 = project_str.split(project_name_time_str)[-1]
|
project_chk_str2 = project_str.split(project_name_time_str)[-1]
|
||||||
project_chk_str2_list = re.split('(:|:)', project_chk_str2)
|
project_chk_str2_list = re.split('(:|:)', project_chk_str2)
|
||||||
@ -512,7 +512,7 @@ def fmt_txt(chk_str):
|
|||||||
if new_p_chk_list:
|
if new_p_chk_list:
|
||||||
for p_str_true in new_p_chk_list:
|
for p_str_true in new_p_chk_list:
|
||||||
if '开发环境' in p_str_true or '开发工具' in p_str_true or '开发技术' in p_str_true or '模块' in p_str_true:
|
if '开发环境' in p_str_true or '开发工具' in p_str_true or '开发技术' in p_str_true or '模块' in p_str_true:
|
||||||
dict_project['position_name'] += re.split('[:|:]', p_str_true)[-1]
|
dict_project['work'] += re.split('[:|:]', p_str_true)[-1]
|
||||||
continue
|
continue
|
||||||
if '项目描述' in p_str_true or '功能介绍' in p_str_true:
|
if '项目描述' in p_str_true or '功能介绍' in p_str_true:
|
||||||
dict_project['comment'] += re.split('[:|:]', p_str_true)[-1]
|
dict_project['comment'] += re.split('[:|:]', p_str_true)[-1]
|
||||||
@ -547,20 +547,20 @@ def fmt_txt(chk_str):
|
|||||||
for work_str in new_str_list:
|
for work_str in new_str_list:
|
||||||
new_str_list1 = work_str.split('工作描述')
|
new_str_list1 = work_str.split('工作描述')
|
||||||
work_dict = {
|
work_dict = {
|
||||||
'name': '',
|
'company_name': '',
|
||||||
'time': '',
|
'time': '',
|
||||||
'work_name': '',
|
'position_name': '',
|
||||||
'duty': new_str_list1[-1],
|
'duty': new_str_list1[-1],
|
||||||
}
|
}
|
||||||
new_str_list2 = new_str_list1[0].split('\n')
|
new_str_list2 = new_str_list1[0].split('\n')
|
||||||
if '?' in new_str_list1[0]:
|
if '?' in new_str_list1[0]:
|
||||||
work_dict['time'] = new_str_list2[0].split('??')[0]
|
work_dict['time'] = new_str_list2[0].split('??')[0]
|
||||||
work_dict['name'] = new_str_list2[0].split('??')[1]
|
work_dict['company_name'] = new_str_list2[0].split('??')[1]
|
||||||
work_dict['work_name'] = new_str_list2[1].split('|')[0]
|
work_dict['position_name'] = new_str_list2[1].split('|')[0]
|
||||||
else:
|
else:
|
||||||
work_dict['time'] = new_str_list2[0]
|
work_dict['time'] = new_str_list2[0]
|
||||||
work_dict['name'] = new_str_list2[2]
|
work_dict['company_name'] = new_str_list2[2]
|
||||||
work_dict['work_name'] = new_str_list2[1]
|
work_dict['position_name'] = new_str_list2[1]
|
||||||
work_list.append(str(work_dict))
|
work_list.append(str(work_dict))
|
||||||
# 公司名开头
|
# 公司名开头
|
||||||
else:
|
else:
|
||||||
@ -605,16 +605,16 @@ def fmt_txt(chk_str):
|
|||||||
for work_str in new_str_list:
|
for work_str in new_str_list:
|
||||||
new_str_list1 = work_str.split('\n')
|
new_str_list1 = work_str.split('\n')
|
||||||
work_dict = {
|
work_dict = {
|
||||||
'name': '',
|
'company_name': '',
|
||||||
'time': '',
|
'time': '',
|
||||||
'work_name': '',
|
'position_name': '',
|
||||||
'duty': '',
|
'duty': '',
|
||||||
}
|
}
|
||||||
new_str_list2 = new_str_list1[0].split(' ', 1)
|
new_str_list2 = new_str_list1[0].split(' ', 1)
|
||||||
work_dict['name'] = new_str_list2[0]
|
work_dict['company_name'] = new_str_list2[0]
|
||||||
work_dict['time'] = new_str_list2[1]
|
work_dict['time'] = new_str_list2[1]
|
||||||
|
|
||||||
work_dict['work_name'] = new_str_list1[1].split(':')[-1]
|
work_dict['position_name'] = new_str_list1[1].split(':')[-1]
|
||||||
work_duty = new_str_list1[3:]
|
work_duty = new_str_list1[3:]
|
||||||
duty1 = new_str_list1[2].split('职责')[-1]
|
duty1 = new_str_list1[2].split('职责')[-1]
|
||||||
duty = duty1.join((str(x) for x in work_duty))
|
duty = duty1.join((str(x) for x in work_duty))
|
||||||
@ -1363,4 +1363,4 @@ web前端开发 | 4001-6000元/月
|
|||||||
有不断学习的良好习惯,能承受高强度的工作压力.热爱技术,喜欢钻研,有志于在手机平台方向长期发展,并能主动承担开发任务,承受工作压力.对移动领域新技术有强烈的兴趣和独立解决问题的能力.有较强的团队合作精神,积极主动,责任心强,能与团队成员进行有效地沟通,及时高效完成任务。
|
有不断学习的良好习惯,能承受高强度的工作压力.热爱技术,喜欢钻研,有志于在手机平台方向长期发展,并能主动承担开发任务,承受工作压力.对移动领域新技术有强烈的兴趣和独立解决问题的能力.有较强的团队合作精神,积极主动,责任心强,能与团队成员进行有效地沟通,及时高效完成任务。
|
||||||
|
|
||||||
"""
|
"""
|
||||||
fmt_txt(chk_str5)
|
fmt_txt(chk_str4)
|
||||||
|
Loading…
Reference in New Issue
Block a user