fix: 控制台 should remain unchanged across all conversion modes#1090
fix: 控制台 should remain unchanged across all conversion modes#1090
Conversation
Agent-Logs-Url: https://github.com/BYVoid/OpenCC/sessions/da202f5c-3ef4-4481-8650-706aa0df5579 Co-authored-by: frankslin <748873+frankslin@users.noreply.github.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 91b01ce7b0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| 懸巖 懸巖 | ||
| 懸巖峭壁 懸巖峭壁 | ||
| 懸胄 懸冑 | ||
| 控制台 控制台 |
There was a problem hiding this comment.
Restrict 控制台 identity to standalone hk2t use
Adding 控制台 控制台 here makes hk2t treat any 控制台* prefix as a fixed phrase, not just the standalone noun. With max-match segmentation (src/MaxMatchSegmentation.cpp) and dictionary priority (HKVariantsRevPhrases before HKVariantsRev), the 台 -> 臺 character conversion is skipped inside that segment, so strings like 控制台北 now remain 控制台北 instead of converting to 控制臺北. This introduces a conversion-accuracy regression for longer phrases that start with 控制台.
Useful? React with 👍 / 👎.
「控制台」was being converted to「控制檯」by an
STPhrasesrule, but「控制台」is the correct and preferred form — it should never be converted in any direction.Changes
data/dictionary/STPhrases.txt: Replace控制台 → 控制檯with identity mapping控制台 → 控制台, blocking the character-level台 → 臺fallback in all s2* modesdata/dictionary/HKVariantsRevPhrases.txt: Add identity entry控制台 → 控制台to suppresshk2t's台 → 臺rule (derived fromHKVariants:臺 → 台reversed)test/testcases/testcases.json: Addconsole_stays_unchangedtest covering all 12 conversion modes (s2t,s2tw,s2twp,s2hk,t2s,t2tw,t2hk,tw2s,tw2sp,tw2t,hk2s,hk2t)