Skip to content

fix: tighten chapter title boundary detection#92

Merged
Handanhhhy merged 5 commits into
mainfrom
fix/chapter-preview-title-boundary
Jul 10, 2026
Merged

fix: tighten chapter title boundary detection#92
Handanhhhy merged 5 commits into
mainfrom
fix/chapter-preview-title-boundary

Conversation

@NewYuee

@NewYuee NewYuee commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

PR 类型 / Type of PR

  • 🐞 Bug 修复 / Bug fix
  • ✨ 新功能 / Feature
  • 📝 文档 / Documentation
  • 🧹 重构 / 清理 / Refactor or cleanup
  • ⚙️ 构建 / CI / Build or CI
  • ⚠️ 破坏性变更 / Breaking change

改动说明 / What this PR does and why

收紧章节标题匹配规则,要求 第X章/第X集、Chapter X/Episode X 后面必须是行尾、空白或常见标题分隔符,避免把 第一集结束。/Episode 1 ends here. 这类正文句子误判为新章节。

同时补充中英文回归测试,确认正文里的章节结束句不会产生重复章节编号。

关联 issue / Linked issues

Fixes #91

给 reviewer 的说明 / Notes for the reviewer

重点关注章节标题边界规则是否覆盖现有导入格式。当前仍支持 Markdown 标题、书名号前缀、冒号/破折号/括号等常见标题分隔符。

面向用户的变更 / User-facing change

修复小说导入章节预览中“第一集结束。”等正文句子可能被误切为重复章节的问题。

自检 / Checklist

  • 已自测,uv run pytest 通过 / Self-tested, uv run pytest passes
  • 必要的文档已更新 / Docs updated where needed
  • 提交信息清晰(建议 Conventional Commits)/ Clear commits (Conventional Commits suggested)
  • 每个 commit 都已 git commit -s 附 DCO 签署 / Every commit signed off with git commit -s (DCO)
  • 我已阅读并同意贡献者协议 / I've read and agree to the contributor terms

验证命令:
UV_CACHE_DIR=/claymorelab/.uv-cache uv run pytest tests/test_api_ingest_chapter_preview.py

@NewYuee
NewYuee force-pushed the fix/chapter-preview-title-boundary branch 2 times, most recently from e210083 to 4755781 Compare July 10, 2026 03:00
@NewYuee
NewYuee requested a review from Handanhhhy July 10, 2026 03:06
Signed-off-by: NewYuee <new.y@foxmail.com>
@NewYuee
NewYuee force-pushed the fix/chapter-preview-title-boundary branch from 4755781 to b1dbe27 Compare July 10, 2026 03:22
@NewYuee NewYuee mentioned this pull request Jul 10, 2026
11 tasks
@Handanhhhy
Handanhhhy merged commit 0902e38 into main Jul 10, 2026
15 checks passed
@Handanhhhy
Handanhhhy deleted the fix/chapter-preview-title-boundary branch July 10, 2026 06:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

剧本文字携带"第一集xxx"开头字样会被误识别成新章节,导致标题及标题序号不匹配

3 participants