feat(identify-words): 识别词——全局识别词(MP 语法)+ 作品识别词(季集换算),规则页「识别词」页签
- 新表 identify_words(0094):全局一块 + 每部作品一块原文,带版本与审计;episode_mapping_rule 转成文本行后删表
- 全局识别词移植 MP WordsMatcher(屏蔽 / 替换 / 集数偏移 / 替换+偏移 / {[tmdbid=…]}),所有按标题 / 文件名识别的地方解析前套用,命中的行记在解析结果上;保存后后台按改动行重新识别
- 作品识别词:S02 >> S01 EP+24 / S01E13 >> S00E01 / S01 @组 >> 忽略,解析器 + 打印器 + 编译;发布组繁简视为同一个
- 去掉规则自动停用:算出来对不上季表只待确认,要停用就注释掉那一行
- 集数待确认的采用 / 忽略与智能体 apply_rule 改为往作品识别词追加一行(带来历注释)
- 编辑器可视化 / 文本两种模式改同一份原文,保存前试算;作品页「集数映射」用同一个编辑器
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Cxwgnn2pbzQ7rXv3rq7fei
This commit is contained in:
1 parent
12f8fc59c3
commit
63e94b308e
90 files changed
+6366
-2131
No files matched your search
@@ -14,7 +14,7 @@ export const CONVERSION_NEAR_DAYS = 7;
|
||||
|
||||
/**
|
||||
* 集数解析总入口(设计文档判定流程 1→4)。纯函数,时间等事实由调用方传入。
|
||||
* 1 有适用规则 → 按规则换算并校验;fail → unresolved + ruleFailed(不回退到确定性换算)
|
||||
* 1 有适用规则 → 按规则换算并校验;fail → unresolved(规则照写的用,不回退到确定性换算,也不停用规则)
|
||||
* 2 原号校验 pass → raw
|
||||
* 3 确定性换算(只取唯一解):原号 fail 时唯一解即采用;原号滞后放行(unverified)时,
|
||||
* 唯一解还要发布时间贴近目标集播出日期(按日期对集的除外),否则按滞后放行
|
||||
@@ -45,32 +45,37 @@ export function resolveEpisodes(input: ResolveEpisodesInput): EpisodeResolution
|
||||
// 1 规则
|
||||
const rule = selectRule(rules, season, parsed.releaseGroup?.name ?? null);
|
||||
if (rule && season !== null) {
|
||||
const ref = {
|
||||
ruleId: rule.id,
|
||||
...(rule.line !== undefined ? { ruleLine: rule.line } : {}),
|
||||
...(rule.text !== undefined ? { ruleText: rule.text } : {}),
|
||||
};
|
||||
const applied = applyRule(rule, season, episodes);
|
||||
if (applied.kind === "special") {
|
||||
return result({
|
||||
method: "rule",
|
||||
canonical: null,
|
||||
ruleId: rule.id,
|
||||
...ref,
|
||||
special: applied.special,
|
||||
evidence: [`rule:special:${applied.special}`],
|
||||
});
|
||||
}
|
||||
if (applied.kind === "error") {
|
||||
return result({ method: "unresolved", canonical: null, ruleFailed: rule.id, evidence: [applied.evidence] });
|
||||
return result({ method: "unresolved", canonical: null, ...ref, evidence: [applied.evidence] });
|
||||
}
|
||||
const v = validateEpisodes(applied.canonical.season, applied.canonical.episodes, table);
|
||||
if (v === "fail") {
|
||||
return result({
|
||||
method: "unresolved",
|
||||
canonical: null,
|
||||
ruleFailed: rule.id,
|
||||
...ref,
|
||||
evidence: [applied.evidence, "rule:validate_fail"],
|
||||
});
|
||||
}
|
||||
return result({
|
||||
method: "rule",
|
||||
canonical: applied.canonical,
|
||||
ruleId: rule.id,
|
||||
...ref,
|
||||
evidence: [applied.evidence, `validate:${v}`],
|
||||
});
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user