def parse_resume(resume):
skills = resume.get('skills', [])
experience_years = resume.get('experience', 0)
return {'skills': skills, 'experience': experience_years}
]]>
jobs_db = [
{"title": "软件工程师", "skills": ["Python", "Java"], "min_experience": 2},
{"title": "数据分析师", "skills": ["SQL", "Excel"], "min_experience": 1},
]
def match_job(user_profile, jobs):
matched_jobs = []
for job in jobs:
if (all(skill in user_profile['skills'] for skill in job['skills']) and
user_profile['experience'] >= job['min_experience']):
matched_jobs.append(job['title'])
return matched_jobs
user_input = {"skills": ["Python", "SQL"], "experience": 3}
matched = match_job(parse_resume(user_input), jobs_db)
print("推荐职位:", matched)
]]>