Repository navigation
s2twp/tw2sp: stop converting ambiguous general words by default, keep technical collocations - #1432
Closed
stantheman0128 wants to merge 8 commits into
Closed
stantheman0128 wants to merge 8 commits into
stantheman0128 wants to merge 8 commits into
Conversation
「程序」在法律、行政語境是兩岸通用詞(法律程序、審批程序),不應因 技術語境預設轉成「程式」;「進程」(歷史進程、作業系統進程)同理。 依 CONTRIBUTING.md 字級規則改為非預設候選(程序 -> 程序 程式),並 補充語義穩定的技術詞組:應用程序、驅動程序、小程序、電腦程序、 計算機程序、程序設計 -> 程式系詞彙,維持既有技術文本的轉換品質。 TWPhrasesRev 同步更新以保持雙向映射封閉。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
「文件」在兩岸都可指公文、資料(政府文件、機密文件),不應預設轉成 「檔案」;「檔案」也可指 archives(歷史檔案、人事檔案),簡體「档案」 同樣通行,不應一律轉成「文件」。改為非預設候選,保留語義穩定的固定 搭配:文件夾、文件名、文件擴展名(既有)與新增的文件系統 -> 檔案系統。 TWPhrasesRev 同步更新以保持雙向映射封閉。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
「資料」可指材料、參考內容(個人資料、參考資料、報名資料),不應 預設轉成「數據」;「統計數據」「實驗數據」「大數據」在臺灣正體也 以「數據」通行,不應預設轉成「資料」。改為非預設候選,保留既有的 數據庫、數據倉庫、數據挖掘、數據源等固定搭配,並補充數據結構、 數據中心、數據集、個人數據 -> 資料系詞彙(臺灣標準用語,如個資法 之「個人資料」)。 BYVoid_OpenCC_Issue_475_mixed_script_input 中混寫輸入「数据庫」原經 「數據 -> 資料」湊出「資料庫」;分詞在簡體詞邊界切為「数据|庫」, 現「數據」預設保留自身,輸出改為同樣正確的「數據庫」。純簡體 「数据库」與純繁體「數據庫」仍轉為「資料庫」。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
「社區」指實體居住區(住宅社區、社區服務、社區醫院),臺灣正體 同樣通行,不應預設轉成「社群」;「社群」指網路、興趣群體,也不應 一律轉回「社區」。改為非預設候選,新增語義穩定的固定搭配: 開源社區 -> 開源社群、社交媒體 -> 社群媒體、社交網站 -> 社群網站、 社區版 -> 社群版(軟體版本名,如 MySQL 社群版),反向對應收入 TWPhrasesRev。variants_tw_s2twp / variants_tw_tw2sp 原斷言通用互轉, 隨預設行為更新。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
「設置」可指設立、安裝(設置路障、設置機構),兩岸通用,不應預設 轉成「設定」;「設定」在臺灣另有故事設定、遊戲設定等用法,反向 也不應一律轉成「設置」。改為非預設候選,UI 語境保留既有的 高級設置 -> 進階設定,並新增系統設置 -> 系統設定、 偏好設置 -> 偏好設定。TWPhrasesRev 同步更新以保持雙向映射封閉。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
「高級」是通用等級形容詞(高級餐廳、高級住宅、高級會員、高級中學), 臺灣正體同樣通行,不應預設轉成「高階」。改為非預設候選,保留既有的 高級設置 -> 進階設定、高級選項 -> 進階選項 與 高端 -> 高階,並新增 術語化詞組 高級語言 -> 高階語言(程式語言分級)。TWPhrasesRev 同步 收入 高階語言 -> 高級語言。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
「執行」可指法律、命令、任務(執行判決、執行任務),兩岸通用, tw2sp 不應預設轉成「運行」;「運行」指系統、列車持續運轉(系統運行、 列車運行),s2twp 也不應預設轉成「執行」。改為非預設候選,保留既有 邊界清楚的執行緒、執行檔等詞組。TWPhrasesRev 同步更新以保持雙向 映射封閉。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
「支持」可指贊成、擁護、資助(支持候選人、財政支持、支持率), 臺灣正體同樣通行,不應預設轉成「支援」。改為非預設候選,收錄語義 穩定的名詞詞組 技術支持 -> 技術支援;既有的 支援 -> 支持(tw2sp) 與 支持者 保護詞條不變。TWPhrasesRev 同步更新以保持雙向映射封閉。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Collaborator
|
cc @skyuns 老師如何看? |
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.
Closes #1313.
Problem
s2twpandtw2spconvert several general words unconditionally, which corrupts ordinary non technical text. Reproduced with the dictionaries at current master:Issue #1313 covers eight word groups (程序/進程/程式, 文件/文檔/檔案, 資料/數據, 社區/社群, 設定/設置/預設, 高級/高階/進階, 執行/運行, 支持/支援) and recommends dropping the generic conversions while keeping semantically stable collocations. 預設 needed no dictionary change; 預設值 and 預設選項 already convert correctly and are now covered by tests.
Change
Each generic mapping keeps the source word as the default candidate and the old conversion as a non default alternative, per the rule in CONTRIBUTING.md (改為非預設候選,
A -> A B) and the precedent of #1423. For example程序 -> 程序 程式and支持 -> 支持 支援in TWPhrases.txt. TWPhrasesRev.txt receives the mirrored updates, including the self mapping candidates described in the repo docs, so the forward and reverse dictionaries stay closed under the reverse mapping test.So that technical text keeps converting well, stable noun collocations are added explicitly (checked against doc/regional-phrase-criteria.md): 應用程序, 驅動程序, 小程序, 電腦程序, 計算機程序 and 程序設計 to their 程式 forms; 文件系統/檔案系統; 數據結構, 數據中心, 數據集 and 個人數據 to their 資料 forms (Taiwan standard usage, as in 個人資料保護法); 技術支持 -> 技術支援; 系統設置 and 偏好設置 -> 設定 forms; 高級語言 -> 高階語言; 社交媒體 -> 社群媒體; 社交網站 -> 社群網站; 社區版 -> 社群版 (software edition, as in MySQL 社群版); 開源社區/開源社群. Existing entries such as 數據庫, 文件夾, 高級設置, 執行緒, 支持者 and the 程序正義 protections are unchanged.
Test changes:
BYVoid_OpenCC_Issue_1313_*) pin the intended behavior for all eight groups in both directions.variants_tw_s2twpandvariants_tw_tw2spasserted the generic 社區/社群 swap and were updated to the new defaults.BYVoid_OpenCC_Issue_475_mixed_script_input: the mixed script token 数据庫 previously came out as 資料庫 only because 數據 -> 資料 fired inside the segment boundary 数据|庫. It now stays 數據庫. The pure script inputs 数据库 and 數據庫 in the same case still convert to 資料庫.The work is split into one commit per word group; every commit keeps both dictionaries sorted (data/scripts/sort.py) and the forward/reverse mapping closed.
Verification
I had no C++ toolchain available, so I verified with the OpenCC 1.4.1 wheel engine driving this branch's text dictionaries directly: config JSONs identical to data/config/*.json with ocd2 references switched to text, and TSCharactersExt, the *Rev variant dictionaries and STPhrases_GeneratedFromRegionalPhrases regenerated with the repo's own scripts. The generator run also confirms the new TWPhrases keys introduce no conflicting simplified projections. There are no conversion related engine changes between ver.1.4.1 and master, and the same harness reproduces master exactly:
Sample before/after from the harness (base = master, mod = this branch):
Please treat the CI Bazel dictionary tests as the authoritative check.
This fix was developed with AI assistance (Claude Code) and verified locally as shown above.