Skip to content

Keep common Simplified 么 words intact in tw2t/tw2s conversion for compatibility - #1473

Merged
frankslin merged 1 commit into
BYVoid:masterfrom
frankslin:upstream-master
Aug 5, 2026
Merged

frankslin merged 1 commit into
BYVoid:masterfrom
frankslin:upstream-master

Conversation

@frankslin

Copy link
Copy Markdown
Collaborator

The generated TWVariantsRev dictionary maps 么 -> 幺 (reversing the Taiwan-standard 幺 -> 么 variant), which corrupted already-Simplified input such as 什么 into 什幺 in tw2t, tw2s and tw2sp (issue #1469).

Add phrase exceptions mapping 什么/怎么/这么/那么/多么/要么/好么/甚么/這么 to their Traditional 麼 forms in TWVariantsRevPhrases.txt, with inline comments so they are not mistaken for typos.

tw2t now outputs proper Traditional (什么 -> 什麼), tw2s reaches the expected Simplified form via the TS stage, and genuine 幺(yao1) words like 老么 still convert to 老幺.

@frankslin frankslin linked an issue Aug 5, 2026 that may be closed by this pull request
@frankslin

Copy link
Copy Markdown
Collaborator Author

See also: nk2028/opencc-js#45

…patibility

The generated TWVariantsRev dictionary maps 么 -> 幺 (reversing the
Taiwan-standard 幺 -> 么 variant), which corrupted already-Simplified
input such as 什么 into 什幺 in tw2t, tw2s and tw2sp (issue BYVoid#1469).

Detailed Changes:
- **TWVariantsRevPhrases.txt**:
  - Add phrase exceptions mapping 什么/怎么/这么/那么/多么/要么/好么/甚么/
    這么 to their 麼 forms, with inline comments so they are not mistaken
    for typos. tw2t now outputs proper Traditional (什么 -> 什麼), tw2s
    reaches the expected Simplified form via the TS stage, and genuine
    yao1 words like 老么 still convert to 老幺. 这么 maps to 这麼 because
    Simplified-to-Traditional 这 -> 這 is the TS/ST stage's job, not the
    variant-reverse stage's.
- **TWVariants.txt**:
  - Add 麼 -> 麼 么 with @reverse-prefer so the generated TWVariantsRev.txt
    lists 么 -> 幺 麼, declaring the 么 -> 麼 substitution required by the
    phrase-character dependency test while keeping 幺 the default.
- **test/testcases/testcases.json**:
  - Add issue-1469 passthrough case covering tw2t and tw2s.
@frankslin

Copy link
Copy Markdown
Collaborator Author

@frankslin
frankslin merged commit 0c547cb into BYVoid:master Aug 5, 2026
40 checks passed
@frankslin
frankslin deleted the upstream-master branch August 5, 2026 19:32
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.

tw2s 转换非幂等:「什么」会被转成「什幺」

1 participant