线代第3讲向量重构为三段式(v2)

- 结构:7 节 14 知识点、48 题,每点「教材 + 扩展 + 习题」三段齐全(14/14/14)
- 教材段 §1—§5 转写 vector.tex;§6 内积与施密特取第 5 讲 similar.tex 正交段;
  §7 公共解取第 4 讲方程组 tex。节首均写明来源边界
- 扩展 90 条:〔张宇〕16、〔补〕74,参考占比 17.8%
- 真题 8 道全部收录(ch11 十年就这 8 题 44 分),答案库中为空、全部自算并 sympy 复核
- 抓出 tex 三处错:vector.tex 的 k*alpha 末项 ka_3、方程组 tex 坐标变换方向写反、
  exercise/3 等价例题 a=0 时 r(A) 误写为 2(实为 3)
- check_source_tags 增加第二条通过路径:〔张宇〕条数 >= 知识点个数
  (薄 tex 篇占比到不了 20%,改为「每点至少一条有据」,比全篇比例更严)
- README 进度表第 12 行更新为 48 题 14 知识点
This commit is contained in:
2026-11-23 00:00:04 +08:00
parent ca7d0ecc64
commit 0e36ac17a0
4 changed files with 684 additions and 206 deletions
+19 -5
View File
@@ -7,12 +7,18 @@
〔补〕 = 参考仓库没有,是我补的(通用知识 / 真题归纳 / 陷阱 / 流程)
混血条目一律标〔补〕——〔补〕的含义是「这句要你自己判断对错」。
通过条件(两条满足其一即可):
A. 〔张宇〕条数占比 ≥ 20%(默认)——适用于母本 tex 足够厚的篇(01 高数、10/11 线代)
B. 〔张宇〕条数 ≥ 知识点个数——即「每个知识点至少有一条能追回原文」。
薄 tex 篇(如 12 向量,vector.tex 只有 149 行)即使全标满也到不了 20%,
此时 B 是更贴切的探针:它要求每一点都有原文支撑,比全篇比例更严。
用法:
python check_source_tags.py # 扫 知识点构建 全目录
python check_source_tags.py --file x.md # 只查一个文件
python check_source_tags.py --min-ref 20 # 〔张宇〕占比下限,默认 20%
退出码:0 通过;1 有缺标或占比异常。
退出码:0 通过;1 有缺标或两条都不满足。
只检查含「**教材**」标记的文件(即已按三段式重构的);旧结构文件跳过并列出。
"""
import io
@@ -77,10 +83,15 @@ def check_file(path, min_ref=20):
total = n_zy + n_bu + n_untag
ref_pct = (100.0 * n_zy / total) if total else 0.0
ok = (not problems) and total > 0 and ref_pct >= min_ref
n_secs = len(secs)
by_ratio = ref_pct >= min_ref
by_point = n_secs > 0 and n_zy >= n_secs
ok = (not problems) and total > 0 and (by_ratio or by_point)
return {
'file': name, 'total': total, 'zy': n_zy, 'bu': n_bu,
'untag': n_untag, 'ref_pct': ref_pct, 'problems': problems, 'ok': ok,
'untag': n_untag, 'ref_pct': ref_pct, 'secs': n_secs,
'by_ratio': by_ratio, 'by_point': by_point,
'problems': problems, 'ok': ok,
}
@@ -110,8 +121,11 @@ def main():
continue
done += 1
flag = 'OK ' if r['ok'] else 'FAIL'
print('%s %-46s 条目%3d 〔张宇〕%3d 〔补〕%3d 参考占比%5.1f%%'
% (flag, r['file'], r['total'], r['zy'], r['bu'], r['ref_pct']))
print('%s %-46s 条目%3d 〔张宇〕%3d 〔补〕%3d 参考占比%5.1f%% 知识点%2d'
% (flag, r['file'], r['total'], r['zy'], r['bu'], r['ref_pct'], r['secs']))
if r['ok'] and not r['by_ratio']:
print(' 注意:占比未达 %.0f%%,但〔张宇〕%d 条 ≥ 知识点 %d 个,按「每点至少一条有据」通过'
% (min_ref, r['zy'], r['secs']))
if r['problems']:
for line, sec, msg in r['problems']:
print(' L%-5d %-22s %s' % (line, sec[:22], msg))