Repository navigation
fix: 修复尾随和声拆分及注音、翻译对齐边界 - #9
Merged
Merged
Conversation
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
LRC placeholder handling can still misplace romanization when multiple placeholders share a timestamp.
Review effort: Lite
Findings: None
What changed in this PR
Fixes trailing harmony splitting and kana/translation alignment edge cases across QRC, KRC, and LRC parsing.
Changes:
- Improves in-word harmony splitting and timing preservation.
- Corrects numeric kana and external kana alignment.
- Adds regression tests for reported edge cases.
| File | Summary |
|---|---|
tests/parsing-regressions.spec.ts |
Adds regression coverage. |
src/utils/kana.ts |
Fixes kana timing across numeric strings. |
src/utils/bg.ts |
Improves in-word trailing harmony splitting. |
src/parse/lrc.ts |
Handles translation and romanization slot alignment. |
src/parse/index.ts |
Defers Kangxi normalization during kana alignment. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
修复尾随和声左括号位于词中间时正文被划入和声的问题,保留括号前的文本及其时间跨度,并支持左括号位于第一个词内、同词包含主唱与和声、日文注音保护等情况。对缺少词内时间信息的片段沿用原始时间跨度。
同时完善 #5、#7、#8 的边界行为:数字串的注音覆盖整个数字串;QRC/KRC 外部 kana 在康熙部首归一化前对齐;LRC 过滤翻译占位符后仍保留罗马音的字段位置。
新增 12 个回归用例,包含 #4 的真实 QRC 样例。验证通过:229 个测试、pnpm lint、pnpm typecheck、pnpm build。
Closes #4