学习路径多阶段化:拓扑层按每阶段≤3技能拆分,阶段命名改为 基础补齐→岗位核心*→项目验证;简历裸姓名/专硕识别修复

This commit is contained in:
RoyirinRosmontis
2026-08-19 12:53:45 +08:00
parent 693e0af93a
commit caf5b106b6
3 changed files with 35 additions and 12 deletions
+12
View File
@@ -105,3 +105,15 @@ def test_resume_bare_name_and_edu_alias():
assert p.education == "硕士" # 专硕→硕士
assert p.address.startswith("辽宁大连")
assert "Python" in p.skills
def test_learning_path_stage_chunking():
"""同层技能超 3 个时拆成多个连续阶段;拓扑序不变。"""
stages = topological_stages(["Linux", "Docker", "Kubernetes", "Python", "Java", "Go", "MySQL"],
load_lexicon())
# 每阶段 ≤3 个技能
assert all(len(st["skills"]) <= 3 for st in stages)
flat = [s for st in stages for s in st["skills"]]
# 前置关系仍满足:Linux 在 Docker 前,Docker 在 Kubernetes 前
assert flat.index("Linux") < flat.index("Docker") < flat.index("Kubernetes")
assert len(stages) >= 3 # 7 个技能至少拆成 3 段