Skip to content

tw2sp:不再將「執行」一律轉為「運行」(#1313) - #1512

Merged
frankslin merged 2 commits into
BYVoid:masterfrom
b84330808:fix-1313-zhixing
Oct 23, 2026
Merged

frankslin merged 2 commits into
BYVoid:masterfrom
b84330808:fix-1313-zhixing

Conversation

@b84330808

Copy link
Copy Markdown
Contributor

修正 #1313 中「執行 / 運行」一項的 tw2sp 方向。

問題:TWPhrasesRev.txt 的 執行 運行 會把所有「執行」轉成「运行」,例如 強制執行 → 强制运行、執行判決 → 运行判决、執行任務 → 运行任务、政策執行 → 政策运行。「執行」在兩岸都是依法實施、依計畫去做的通用詞,大陸法律用語同樣是「强制执行」「执行程序」;「運行」則指循軌跡運轉。

修改:

  • 比照 AGENTS.md 所述單向轉換的做法(信道 → 通道),在 TWPhrases.txt 加入自我對應 執行 執行,並將 TWPhrasesRev.txt 改為 執行 執行 運行:s2twp 的 运行 → 執行 不變,tw2sp 預設保留「執行」,反向對照仍完整。
  • 執行緒 → 线程、執行檔 → 可执行文件、執行長 → 首席执行官 等既有詞組不受影響。
  • 新增 tw2sp、s2twp 測試案例。

依據:

已知影響:tw2sp 中「執行程式」由「运行程序」變為「执行程序」,兩者在大陸皆通行。s2twp 方向的 运行 → 執行(如 地球运行 → 地球執行)牽涉軟體語境的動詞用法,本 PR 不處理。

測試:本機以 CMake 建置並執行 ctest(21/21 通過,含跑 testcases.json 的 CommandLineConvertTest):修改前新 tw2sp 案例失敗,修改後通過。Bazel 專屬的詞典測試(排序/去重、正反向對照、分詞覆蓋等)以同一建置另行編譯執行,均通過;golden 測試與 sort.py 排序檢查亦通過。完整 Bazel 測試待 CI 確認。

與 #1511 相互獨立,可分別審閱(兩者合併後測試亦通過)。

此變更使用 Claude Code 撰寫。

執行 is the standard word in both Taiwan and Mainland usage for carrying
out laws, orders, tasks and policies (強制執行, 執行判決, 執行任務), so the
generic 執行 -> 運行 rule in TWPhrasesRev over-converts. Make the s2twp
運行 -> 執行 rule one-way, following the documented 信道 -> 通道 pattern:
TWPhrases gains the self-mapping 執行 -> 執行, and TWPhrasesRev now maps
執行 -> 執行 運行 so tw2sp keeps 執行. 執行緒, 執行檔 and 執行長 keep their
existing reverse conversions.
Comment thread test/testcases/testcases.json Resolved
@frankslin
frankslin merged commit bcf847c into BYVoid:master Oct 23, 2026
40 of 41 checks passed
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