Skip to content

Sync TWVariantsRevPhrases with STPhrases to disambiguate 梁/樑 in tw2t - #1424

Merged
frankslin merged 2 commits into
BYVoid:masterfrom
LeeiFrankJaw:sync_TW-ST
Jul 19, 2026
Merged

frankslin merged 2 commits into
BYVoid:masterfrom
LeeiFrankJaw:sync_TW-ST

Conversation

@LeeiFrankJaw

@LeeiFrankJaw LeeiFrankJaw commented Jul 14, 2026 •

Copy link
Copy Markdown
Contributor

In Taiwan standard the beam sense of 樑 is written as 梁, so it collapses
with the surname/place-name 梁. Character-level TWVariantsRev cannot tell
the two apart on the way back, which left tw2t (and the tw2* segmentation
chain) unable to restore 樑 for beam phrases — 橋梁 round-tripped to 橋樑
via s2t but stayed 橋梁 via tw2t, an inconsistency with STPhrases.

This adds the missing phrase-level reverse mappings so that whole beam
phrases are recovered from context, while genuine 梁 words (surnames,
place names) are preserved.

Detailed Changes:

  • TWVariantsRevPhrases.txt:
    • Add 41 beam-sense entries mirroring the 梁 -> 樑 phrases in STPhrases
      (e.g. 上梁文 -> 上樑文, 國家棟梁 -> 國家棟樑, 橫打鼻梁兒 -> 橫打鼻樑兒),
      so tw2t converts the Taiwan 梁 form back to the OpenCC-standard 樑.
    • Keep self-mapping entries where 梁 must be preserved (白鶴梁, 梁木,
      梁龍, ...) so proper nouns are not over-converted.
  • test/testcases/testcases.json:
    • Add a tw2t case covering all 41 new entries, guarding the beam-vs-name
      distinction against regressions.

LeeiFrankJaw and others added 2 commits July 14, 2026 16:21
Cover the 41 TWVariantsRevPhrases entries added in this PR with a tw2t
case so the Taiwan-form 梁 phrases convert to the OpenCC-standard 樑 form.
@frankslin frankslin changed the title Synchronize between STPhrases and TWVariantsRevPhrases about 樑 Sync TWVariantsRevPhrases with STPhrases to disambiguate 梁/樑 in tw2t Jul 19, 2026
@frankslin
frankslin merged commit f2c9987 into BYVoid:master Jul 19, 2026
39 of 40 checks passed
@LeeiFrankJaw
LeeiFrankJaw deleted the sync_TW-ST branch July 19, 2026 21:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants