Keep the Taiwan standard form 祕 in s2tw and s2twp - #1493
Merged
Merged
Conversation
TWVariants mapped 祕 to 秘, undoing the STCharacters 秘 to 祕 conversion, so s2tw produced 秘書 where s2t produced 祕書. The Taiwan MOE dictionaries give 祕書 as the standard form, so the mapping is dropped; the Hong Kong variant keeps 秘 and is untouched.
Resolve the testcases.json conflict by keeping both the new Seal script cases from master and the 祕 cases from this branch.
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.
Fixes #1490.
TWVariants.txtmapped祕 -> 秘, which undid theSTCharacters秘 -> 祕conversion later in thes2twchain. The result was thats2tands2twdisagreed on the same input:The Taiwan MOE dictionaries give 祕 as the standard form — 祕書, 祕書長 — so the Taiwan variant mapping is not needed, as @frankslin and @LeeiFrankJaw noted in the issue.
Change
One line removed from
TWVariants.txt.TWVariantsRevis generated from it at build time, so the reverse direction follows automatically, and there were no祕/秘entries inTWVariantsPhrases.txt,TWVariantsRevPhrases.txt,TWPhrases.txtorTWPhrasesRev.txtto keep in sync.HKVariants.txtkeeps祕 -> 秘and is untouched, along with the four祕書處 -> 秘書處entries inHKVariantsPhrases.txt.After:
One behaviour change worth a look
TWVariantsRevpreviously normalised秘 -> 祕, sotw2tandtw2srewrote a Taiwan-side秘. Both are now identity for that character:Since
祕is the Taiwan standard, a秘in Taiwan input is already non-standard and leaving it alone seems right, but it is the one thing this removal changes beyond the reported bug. Happy to restore normalisation another way if you would rather keep it.Tests
test/testcases/testcases.jsoncoverings2t/s2tw/s2twp, thes2hkform, andt2twidentity.s2tw,s2twp,s2tw_jieba,s2twp_jieba. Each differs from the old file by exactly three characters, all秘→祕— the US Constitution text has "秘書 威廉·傑克遜".s2t,s2t_jieba,s2hk,s2hkp,s2hk_jieba,s2hkp_jiebaregenerate byte-identical.Built with CMake (core plus the Jieba plugin, so the jieba goldens were regenerated rather than hand-edited) and ran every pair in
testcases.jsonthrough the built CLI:I could not run the Bazel suites — Bazel is not available in my environment — so
//data/dictionary:...and the golden test targets have not been exercised here beyond the manual regeneration above.AI disclosure
Written with AI assistance (Claude Code): the investigation, the change, the tests, and this description.
🤖 Generated with Claude Code