Repository navigation
fix(ttml): 支持 AM 歌词简繁替换并过滤重复翻译与音译 - #17
Open
kid141252010 wants to merge 2 commits into
Open
kid141252010 wants to merge 2 commits into
kid141252010 wants to merge 2 commits into
Conversation
- Exclude replacement tracks from subtitles and prevent cross-script Chinese fallbacks. - Suppress identical translations and romanizations per main line and individual background line. - Add regression coverage and document the parser behavior. Verified: 115 focused tests passed; TypeScript typecheck passed.
- Select matching replacement tracks for main lyrics and individual background lines in both Chinese scripts. - Reuse content parsing to retain replacement word timings, whitespace and annotations; retain original timing for untimed replacement text. - Compare translations and romanizations against the selected replacement text. - Cover both script directions and update API and README documentation. Verified: 125 focused tests passed; TypeScript typecheck and both real-world samples passed.
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.
变更内容
按语言偏好替换正文
translation type="replacement"与普通翻译字幕分开处理。preferredLang为zh-CN/zh-Hans时,优先使用匹配的简体 replacement;繁体偏好同理。x-bg的正文替换。屏蔽重复翻译与音译
x-bg为比较区域,基于替换后的正文判断重复。translatedLyric。romanLyric,同时不挂载romanWord。x-bg独立匹配,避免辅助歌词相互拼接或串用。兼容性
parseTTML与parseLyric均生效,无需新增配置项。preferredLang类型说明及中英文 README。