Skip to content

s2t: align 惊叹/赞叹/咏叹 etc. to 嘆 per 國語辭典 (#641) - #1451

Closed
stantheman0128 wants to merge 1 commit into
BYVoid:masterfrom
stantheman0128:fix/641-jingtan
Closed

stantheman0128 wants to merge 1 commit into
BYVoid:masterfrom
stantheman0128:fix/641-jingtan

Conversation

@stantheman0128

Copy link
Copy Markdown
Contributor

Closes #641.

Problem

STCharacters.txt already prefers 叹 -> 嘆 歎, and many related phrases already map to 嘆, but several STPhrases.txt rows still force 歎. That leaves OpenCC inconsistent with 《重編國語辭典修訂本》 on the issue's ? rows, for example:

惊叹 -> 驚歎
赞叹 -> 讚歎
咏叹 -> 詠歎
叹服 -> 歎服
叹为观止 -> 歎爲觀止

Change

Update only the still-wrong phrase rows (and their direct compounds) that the issue marks as ? versus 國語辭典:

  • 惊叹 / 大表惊叹 -> 驚嘆 / 大表驚嘆
  • 赞叹 / 赞叹不已 / 赞叹声 / 啧啧赞叹 -> 讚嘆...
  • 咏叹 -> 詠嘆
  • 叹服 -> 嘆服
  • 叹为观止 -> 嘆爲觀止 (keeps OpenCC 爲; s2tw/s2hk still project to 為)

Left unchanged: literary rows where the issue already agrees on 歎 (叹吁 / 叹羡 / 叹赏, etc.), and character-level 叹 -> 嘆 歎.

Also refresh case_012 (赞叹... -> 讚嘆...) and add #641 testcases.

Test plan

  • New cases BYVoid_OpenCC_Issue_641_tan_to_tan and BYVoid_OpenCC_Issue_641_tan_controls
  • Local verification with OpenCC 1.4.1 wheel + branch text dictionaries (see Evidence)
  • CI Bazel dictionary / command_line tests (authoritative)

Evidence

Installed wheel s2t (published dicts, before this fix):

惊叹 -> 驚歎
赞叹 -> 讚歎
咏叹 -> 詠歎
叹服 -> 歎服
叹为观止 -> 歎爲觀止
惊叹号 -> 驚歎號
咏叹调 -> 詠歎調
大表惊叹 -> 大表驚歎
啧啧赞叹 -> 嘖嘖讚歎
赞叹不已 -> 讚歎不已
拍桌惊叹 -> 拍桌驚歎
叹吁 -> 歎吁
叹羡 -> 歎羨
叹赏 -> 歎賞

This branch, text-dict harness driving data/dictionary/*.txt (config JSONs with ocd2 refs switched to text; STPhrases_GeneratedFromRegionalPhrases stubbed):

惊叹 -> 驚嘆
赞叹 -> 讚嘆
咏叹 -> 詠嘆
叹服 -> 嘆服
叹为观止 -> 嘆爲觀止
惊叹号 -> 驚嘆號
咏叹调 -> 詠嘆調
大表惊叹 -> 大表驚嘆
啧啧赞叹 -> 嘖嘖讚嘆
赞叹不已 -> 讚嘆不已
拍桌惊叹 -> 拍桌驚嘆
叹吁 -> 歎吁
叹羡 -> 歎羨
叹赏 -> 歎賞

Harness summary:

testcases: 511/527 passed, 16 failed
baseline excl #641: 503/519 passed, 16 failed
s2t expectations match excl #641/case_012: 93 same, 0 diff
#641 cases: 8/8 ok

The 16 baseline failures are the pre-existing stub gaps from omitting generated regional STPhrases (same class as other recent dictionary PRs). sort.py on STPhrases.txt is idempotent after the edit.

Please treat CI Bazel tests as authoritative; no local C++/Bazel toolchain was available here.

AI assistance

This fix was developed with AI assistance (Cursor / Grok) and verified locally as shown above.

STCharacters already prefers 嘆, but several STPhrases rows still forced 歎
on the issue's disputed forms. Update those rows and direct compounds only;
keep literary 歎 entries the issue already agrees on.

Co-authored-by: Cursor <cursoragent@cursor.com>
@frankslin frankslin closed this Jul 17, 2026
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