fix: include matching body sections despite nonempty semantic recall
This commit is contained in:
@@ -100,11 +100,17 @@ def _body_navigator(db, *, course_version_id, project_id, category):
|
||||
label = normalize_heading(target.get("label") or "")
|
||||
if not label:
|
||||
return []
|
||||
# A rubric often says simply "计划", while the actual section is future
|
||||
# work. Expand only this concept; headings still have to exist in body text.
|
||||
labels = [label]
|
||||
plan_terms = ("计划", "后续改进", "后续工作", "未来工作", "下一阶段", "下一步")
|
||||
if any(term in label for term in plan_terms):
|
||||
labels.extend(plan_terms)
|
||||
candidates = []
|
||||
for heading, places in headings.items():
|
||||
if not heading:
|
||||
continue
|
||||
if heading.startswith(label) or label.startswith(heading) or label in heading or heading in label:
|
||||
if any(term in heading or heading in term for term in labels):
|
||||
candidates.extend(places)
|
||||
if not candidates:
|
||||
return []
|
||||
|
||||
Reference in New Issue
Block a user