Skip to content

fix(dictionary): update TSPhrases for 乾紅/谿/列印度/喬治亞 (#901) - #1447

Closed
stantheman0128 wants to merge 1 commit into
BYVoid:masterfrom
stantheman0128:fix/901-tsphrases
Closed

stantheman0128 wants to merge 1 commit into
BYVoid:masterfrom
stantheman0128:fix/901-tsphrases

Conversation

@stantheman0128

Copy link
Copy Markdown
Contributor

Closes #901.

Problem

TSPhrases.txt was missing several phrase-level overrides requested in #901:

  1. Longer 乾紅* forms for dry-red wine / dried safflower / dried jujube (干红*), beyond the short 乾紅 -> 干红 乾红 entry from t2s: 乾斷食 → 干断食, 乾紅 → 干红 #1429 / TS 可能的过度转换:乾斷,乾紅 #621.
  2. Classical 谿 compounds (豁谿 / 谿刻 / 谿卡 / 谿壑) were simplified to 溪 via TSCharacters, even though these should keep 谿 (related: update TSCharacters.txt #905).
  3. Under tw2sp, 列印 -> 打印 is applied by longest prefix match inside longer strings, so:
位列印度 -> 位打印度
一列印度火車 -> 一打印度火车
位列印尼 -> 位打印尼
一列印尼火車 -> 一打印尼火车
  1. Personal names with an interpunct after 喬治亞 should stay 乔治亚·... in mainland mode (related: 納米比亞,喬治亞州,喬治亞共和國 轉換問題 #902).

Change

data/dictionary/TSPhrases.txt:

乾紅棗 -> 干红枣
乾紅花 -> 干红花
乾紅葡萄酒 -> 干红葡萄酒
豁谿 / 谿刻 / 谿卡 / 谿壑 -> identity (keep 谿)
列印度 / 列印尼 -> identity
喬治亞· -> 乔治亚·

TWPhrasesRev.txt / TWPhrases.txt (needed for tw2sp / reverse-mapping closure; same MaxMatch pattern as #907):

列印度 -> 列印度
列印尼 -> 列印尼

Ordinary 列印 -> 打印 is unchanged. Dictionaries sorted with data/scripts/sort.py.

Test plan

  • New cases BYVoid_OpenCC_Issue_901_* in test/testcases/testcases.json
  • Control: 列印 -> 打印 under tw2sp
  • Local verification with OpenCC 1.4.1 wheel + branch text dictionaries (see Evidence)
  • CI Bazel dictionary tests (authoritative)

Evidence

Repro before (packaged wheel dictionaries, or master text dicts for the tw2sp 列印 case):

t2s    豁谿 / 谿刻 / 谿卡 / 谿壑 -> 豁溪 / 溪刻 / 溪卡 / 溪壑
tw2sp  位列印度 -> 位打印度
tw2sp  一列印度火車 -> 一打印度火车
tw2sp  位列印尼 -> 位打印尼
tw2sp  一列印尼火車 -> 一打印尼火车

After this branch (config JSONs with ocd2 refs switched to text, driving data/dictionary/*.txt on the branch):

t2s/tw2sp  乾紅葡萄酒 -> 干红葡萄酒
t2s/tw2sp  乾紅花 -> 干红花
t2s/tw2sp  乾紅棗 -> 干红枣
t2s/tw2sp  豁谿谿刻谿卡谿壑 -> 豁谿谿刻谿卡谿壑
tw2sp      位列印度一列印度火車 -> 位列印度一列印度火车
tw2sp      位列印尼一列印尼火車 -> 位列印尼一列印尼火车
tw2sp      列印 -> 打印
tw2sp/t2s  喬治亞·馬克 -> 乔治亚·马克

Harness summary (OpenCC 1.4.1 wheel, config ocd2 references rewritten to text):

reverse mapping closure (TWPhrases): MISSING = 0
sort.py idempotence on TSPhrases/TWPhrases/TWPhrasesRev: no further diff
master vs branch on existing t2s/tw2sp expectations: new_fail = 0 (5 same pre-existing text-harness gaps on both)
branch dicts + new #901 cases: 8 passed, 0 failed

Please treat CI Bazel dictionary tests as authoritative.

AI assistance

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

…列印 substrings (BYVoid#901)

Co-authored-by: Cursor <cursoragent@cursor.com>
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.

update TSPhrases.txt

2 participants