Repository navigation
s2t: 為「复盘 → 復盤」補充顯式詞條與測試 - #1427
Merged
Merged
Conversation
Lock in the Simplified-to-Traditional conversion of 复盘 as 復盤 with an explicit phrase entry and round-trip test cases, so the behavior restored by the PR #758 follow-up no longer depends solely on the first-candidate order of 复 in STCharacters.
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.
背景
在 56d028a(#758 的後續修正)之前,
STPhrases.txt中存在錯誤詞條复盘 → 覆盤,因此已發布版本的s2t會把「复盘」轉成「覆盤」。該修正將詞條的 key 改為覆盘之後,「复盘」的正確輸出「復盤」目前僅依賴STCharacters.txt中复 → 復 複 覆的首位候選順序——既沒有顯式詞條,也沒有任何測試鎖定。考慮到這個詞條一週前才剛修正過,值得用顯式詞條與回歸測試把行為固定下來。修改內容
data/dictionary/STPhrases.txt:新增复盘 復盤(已用data/scripts/sort.py排序)。與既有的复原 復原、复活 復活等與首位候選一致的顯式詞條慣例相符。test/testcases/testcases.json:新增case_063_s2x(s2t/s2tw:赛后复盘 覆盘难照 → 賽後復盤 覆盤難照)與case_064_t2x(t2s往返:賽後復盤 覆盤難照 → 赛后复盘 覆盘难照),同時覆蓋新詞條與 56d028a 中改 key 後的覆盘 → 覆盤詞條。為何是「復盤」而非「覆盤」
覆盘 → 覆盤詞條處理該情形。`复盘 → 覆盤` 這種跨字位的映射本身就與 繁简转换「牴 -> 抵」;「復、複、覆」相关修正 #758 系列修正的原則相悖。覆盘 → 覆盤保留,不受本 PR 影響。驗證
.ocd2後實測:s2t/s2tw/s2twp/s2hk的「复盘」均輸出「復盤」;t2s往返一致(復盤 → 复盘、覆盤 → 覆盘)。testcases.json全部 213 例:新增 2 例通過,其餘結果與 master 完全一致(master 上既有的 3 例 runner 差異與本修改無關)。sort.py冪等、key 唯一、格式檢查通過。