Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

module(
name = "opencc",
version = "1.4.1",
version = "1.4.2",
)

bazel_dep(name = "aspect_bazel_lib", version = "2.22.5")
Expand Down
13 changes: 8 additions & 5 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
# Change History of OpenCC

## Unreleased
## Version 1.4.2

* **發佈重點**:轉換熱路徑大幅加速(純文字語料的整體轉換時間最多降至原本的 1/7),修復大端序平台載入 legacy `.ocd` 字典得到空字典的問題,並新增兩個實驗性 API(詞級候選查詢與一對多歧義標註,含 CLI `--ambiguities`)。詞庫方面修正了 `s2twp` 的數處貪婪匹配錯誤與 `tw2t`/`tw2s` 對簡體「么」的破壞性轉換,並補充臺灣/香港地區詞。C++ ABI 與 1.4.1 相同(SOVERSION 1.4),實驗性 API 皆位於未安裝的私有標頭或巨集開關之後,下游程式無需重新連結。
2026年8月22日

* **發佈重點**:轉換熱路徑大幅加速(純文字語料的整體轉換時間最多降至原本的 1/7),修復大端序平台載入 legacy `.ocd` 字典得到空字典的問題,並新增兩個實驗性 API(詞級候選查詢與一對多歧義標註,含 CLI `--ambiguities`)。詞庫方面修正了 `s2twp` 的數處貪婪匹配錯誤與 `tw2t`/`tw2s` 對簡體「么」的破壞性轉換,補充臺灣/香港地區詞,並修正古籍語境下 `s2t` 的一對多字用字。C++ ABI 與 1.4.1 相同(SOVERSION 1.4),實驗性 API 皆位於未安裝的私有標頭或巨集開關之後,下游程式無需重新連結。
* **詞庫更新**:
* 修復 `tw2t`/`tw2s`/`tw2sp` 會把已是簡體的「什么」轉成「什幺」的問題:生成的 `TWVariantsRev` 含 `么 -> 幺`(臺灣標準 `幺 -> 么` 的反向),在 `TWVariantsRevPhrases.txt` 補上「什么/怎么/这么/那么/多么/要么/好么/甚么」等例外映射至「麼」形,同時保留「老么 → 老幺」等真正的 yao1 詞([#1469](https://github.com/BYVoid/OpenCC/issues/1469), [#1473](https://github.com/BYVoid/OpenCC/pull/1473))。
* 修復 `s2twp` 因較短詞條先命中而拆錯詞的問題:補上「互联网络」「快闪存储器」「老挝人民民主共和国」的完整詞條,並將「老撾人民民主共和國」對應到臺灣官方譯名「寮人民民主共和國」([#1467](https://github.com/BYVoid/OpenCC/issues/1467), [#1468](https://github.com/BYVoid/OpenCC/pull/1468))。
* 「梁/樑」:新增臺灣地區用字映射與人名、地名保護詞條([#1407](https://github.com/BYVoid/OpenCC/pull/1407));並將 `TWVariantsRevPhrases` 與 `STPhrases` 對齊,補上 41 條梁(棟梁義)的反向詞組映射,使 `tw2t` 能從上下文還原「橋樑」而不誤傷姓氏、地名([#1424](https://github.com/BYVoid/OpenCC/pull/1424))。
* 新增奧斯卡最佳導演與最佳影片製片人的臺灣/香港譯名詞條(取自中文維基百科 `NoteTA` 地區詞表並以 Wikidata 交叉核對,僅收錄真正存在音譯差異者,如 卡梅隆/卡麥隆/金馬倫)([#1466](https://github.com/BYVoid/OpenCC/pull/1466))。
* 新增地區詞「內存條 → 記憶體模組」(`s2twp`/`s2hkp`,含反向詞條)([#1475](https://github.com/BYVoid/OpenCC/pull/1475))、「数字人文 → 數位人文」(`s2twp`/`tw2sp`)([#1465](https://github.com/BYVoid/OpenCC/pull/1465))。
* `s2t`:修正古籍語境下一對多字的用字。`征`/`咸`/`斗`/`里`/`范`/`岳`/`冲`/`郁`/`谷` 在 `STPhrases` 沒有對應詞條時會退回 `STCharacters`,而那裏的候選次序是按現代用法排的,碰上文言文和書名就常常選錯。此次按義項補入詞條:征伐義(`征南`、`从征实录`)、年號與副詞義(`咸淳`、`少长咸集`)、星宿義(`斗姆`、`东斗星君`)、地名與音譯(`甫里`、`摩里支`)、姓氏義(`范文正`、`岳武穆`)、道教與梵語音譯(`道冲`、`郁迦罗越`);`谷神` 改為保留「谷」(《老子》「谷神不死」),`谷神星` 則因鍵更長,仍映射為「穀神星」。這批問題是在清理殆知閣文獻時發現的,該批書名中 47 條誤轉修正了 46 條,現代語義的轉換一律不受影響([#1479](https://github.com/BYVoid/OpenCC/pull/1479))。
* `s2t`:「小丑」不再預設轉換為「小醜」([#1423](https://github.com/BYVoid/OpenCC/pull/1423));「雇」改為 `STCharacters` 中「僱」以外的非預設候選([#906](https://github.com/BYVoid/OpenCC/pull/906));新增「这周/那周/若干周/几周/周线 → 週」等指示與量化用法,並補上「周围/周边/周遭」的分詞保護詞條([#1428](https://github.com/BYVoid/OpenCC/pull/1428));新增顯式詞條「复盘 → 復盤」,使其不再只依賴 `复` 的候選順序([#1427](https://github.com/BYVoid/OpenCC/pull/1427))。
* `t2s`:修正過度轉換「乾斷食 → 干断食」「乾紅 → 干红」([#621](https://github.com/BYVoid/OpenCC/issues/621), [#1429](https://github.com/BYVoid/OpenCC/pull/1429))。
* 修正「鑒」相關詞條與若干提稱語,如「郝铭鉴 → 郝銘鑒」([#1421](https://github.com/BYVoid/OpenCC/pull/1421))。
Expand All @@ -23,12 +26,12 @@
* npm 套件的源碼編譯 fallback 從 node-gyp 改為 Bazel:原生 addon 優先透過 `@opencc/opencc-<platform>-<arch>` 預編譯 scoped 套件安裝(涵蓋 macOS x64/arm64、Linux x64/arm64、Windows x64,均以 Bazel 構建,字典隨包預編譯);沒有預編譯二進位套件的平台,`npm install` 會以 Bazel 完整地從源碼構建——編譯 `//node:opencc` 並重新生成字典(`bazel` / `bazelisk` 取自 PATH,或經 `npx` 自動下載 bazelisk;字典生成腳本的 Python 由 Bazel hermetic 工具鏈提供)。`binding.gyp` 與 `.gypi` 構建定義刪除,`node-gyp`、`node-gyp-build`、`node-addon-api`、`prebuildify` 依賴與 `prebuild` npm script 一併移除;tarball 不再攜帶 `deps/`(C++ 三方依賴改由 Bazel Central Registry 提供),改為攜帶 Bazel workspace、`src/` C++ 源碼與 `data/` 字典源檔([#1426](https://github.com/BYVoid/OpenCC/pull/1426), [#1430](https://github.com/BYVoid/OpenCC/pull/1430))。
* CI 測試任務、Makefile target 與源碼 checkout 的開發構建一併改用 Bazel,與 npm 發佈所用的構建路徑一致;Windows CI 任務移至 `windows-2025-vs2026`([#1426](https://github.com/BYVoid/OpenCC/pull/1426))。
* **打包 / 構建系統**:
* `packaging/debian/` 同步至 Debian 的 `1.4.1+ds1-7`。Debian 已採納上游先前提出的兩項提案:jieba 插件打包(拆為 `opencc-jieba` 與 arch:all 的 `opencc-jieba-data` 兩個套件,內嵌 cppjieba 的理由記於 `debian/README.source`)與 `*.ocd2` 移入 `libopencc-data`;Debian 端亦重新啟用了 autopkgtest。`packaging/debian/SPLIT_PROPOSAL.md` 隨提案落地移除。
* `packaging/debian/` 同步至 Debian 的 `1.4.1+ds1-8`。Debian 已採納上游先前提出的 jieba 插件打包提案(拆為 `opencc-jieba` 與 arch:all 的 `opencc-jieba-data` 兩個套件,內嵌 cppjieba 的理由記於 `debian/README.source`);Debian 端亦重新啟用了 autopkgtest。`packaging/debian/SPLIT_PROPOSAL.md` 隨提案落地移除。另外 `1.4.1+ds1-8` 修復了 `.ocd2` 被放進 `Architecture: all` 套件的問題:`.ocd2` 是依主機位元組序寫出的 marisa-trie 映像,所有架構都會拿到 arch:all buildd 上構建的小端序副本,opencc 在 s390x 上因而以 `size > avail_` 失敗(Debian bug [#1145010](https://bugs.debian.org/1145010),由重新啟用的 s390x autopkgtest 揪出)。`*.ocd2` 已移回 arch:any 的 `libopencc1.4`、`jieba_merged.ocd2` 移回 arch:any 的 `opencc-jieba`;`libopencc-data` 與 `opencc-jieba-data` 現在只含 JSON 配置與純文字 jieba 詞典來源。
* Debian 套件構建改在 `debian:sid` 容器中進行(同步來的打包以 unstable 為目標,Ubuntu LTS runner 無法滿足),並在 `dpkg-buildpackage` 前套用 `debian/patches` quilt series(自動跳過已在樹中的補丁);arm64 改用 `ubuntu-24.04-arm` runner 原生構建,取代先前的交叉構建([#1420](https://github.com/BYVoid/OpenCC/pull/1420))。
* 新增 `packaging/freebsd/`:FreeBSD ports tree `chinese/opencc` 條目的參考副本,供上游審閱與準備提交給 port maintainer 的改動。
* 新增精簡 C++ 源碼包發佈流程(`release-source.yml`):以 `OPENCC_SOURCE_PACKAGE_PROFILE=opencc` 產生僅含 C++ 核心的 CPack 壓縮包(不含 Node.js、Python、文檔、packaging 與 plugins),並以 CMake 與 Bazel 雙路徑冒煙測試後上傳至 draft release;為此保留 Bazel workspace 檔案與頂層 `patches/`,僅排除可能含 API key 的 `.bazelrc.user`。
* 修正 `cmake/GitVersion.cmake` 的 fallback 版本號:1.4.1 發佈時仍停留在 1.4.0,導致從釋出的 tarball(無 git 資訊)構建時版本回報為 1.4.0。
* Windows 發佈簽章改用 SignPath 的 release-signing policy,並新增對 win32-x64 npm 二進位(`opencc.node`、`opencc-jieba.dll`)的 Authenticode 簽章([#1458](https://github.com/BYVoid/OpenCC/pull/1458), [#1459](https://github.com/BYVoid/OpenCC/pull/1459))。
* 修正 `cmake/GitVersion.cmake` 的 fallback 版本號:1.4.1 發佈時仍停留在 1.4.0,導致從釋出的 tarball(無 git 資訊)構建時版本回報為 1.4.0;本次發佈同步將其更新至 1.4.2,並讓 `scripts/compute-version.sh` 的 fallback 與之一致(先前停留在 1.2.1)。因此 Debian 打包的 `0010-fix-git-version-fallback.patch` 對 1.4.2 已無作用而移除,`0012-fix-legacy-dict-detection-on-big-endian.patch` 亦已包含於本次發佈。
* Windows 發佈自本版起啟用程式碼簽章憑證:可攜式 CLI 壓縮包中的執行檔,以及 win32-x64 npm 二進位(`opencc.node`、`opencc-jieba.dll`)皆經 Authenticode 簽章,簽章服務由 [SignPath.io](https://about.signpath.io/) 免費提供、憑證由 [SignPath Foundation](https://signpath.org/) 免費提供,發佈流程改用其 release-signing policy;相關聲明與簽章/隱私政策見 README 的「Code Signing 程式碼簽章」一節([#1458](https://github.com/BYVoid/OpenCC/pull/1458), [#1459](https://github.com/BYVoid/OpenCC/pull/1459))。
* **測試**:
* `PrefixMatchTest` 改用測試專屬的字典檔名,避免與 `MarisaDictTest` 在共享工作目錄下爭用同一個 `dict.ocd2`,該競爭會使並行 ctest(如 `dh_auto_test` 的 `ctest -j8`)偶發失敗。

Expand Down
41 changes: 35 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,18 @@ For details, see [Design Principles](./DESIGN_PRINCIPLES.md) and [Regional Phras

### Prebuilt binaries 預編譯二進位檔

OpenCC 1.4.1 修復了 `opencc` npm 套件在無預編譯二進制平台上源碼編譯安裝失敗的
問題,並包含一批詞庫修正;C++ ABI 與 1.4.0 相同(SOVERSION 1.4),自 1.4.0
升級的下游 C++ 程式無需重新連結。
OpenCC 1.4.2 大幅加速了轉換熱路徑(純文字語料的整體轉換時間最多降至原本的
1/7),修復了大端序平台載入 legacy `.ocd` 字典得到空字典的問題,並包含一批詞庫
修正;C++ ABI 與 1.4.1 相同(SOVERSION 1.4),自 1.4.0/1.4.1 升級的下游 C++
程式無需重新連結。

* Windows (x86_64): [OpenCC-1.4.1](https://github.com/BYVoid/OpenCC/releases/download/ver.1.4.1/OpenCC-1.4.1-windows-x64-portable.zip) ([SHA-256](https://github.com/BYVoid/OpenCC/releases/download/ver.1.4.1/OpenCC-1.4.1-windows-x64-portable.zip.sha256))
* Windows (x86_64): [OpenCC-1.4.2](https://github.com/BYVoid/OpenCC/releases/download/ver.1.4.2/OpenCC-1.4.2-windows-x64-portable.zip) ([SHA-256](https://github.com/BYVoid/OpenCC/releases/download/ver.1.4.2/OpenCC-1.4.2-windows-x64-portable.zip.sha256))
* This Windows release is available from WinGet. For details, see [doc/windows-winget-release.md](doc/windows-winget-release.md).
* The executables are Authenticode-signed; see [Code Signing 程式碼簽章](#code-signing-程式碼簽章).
* Requires Microsoft Visual C++ Redistributable for Visual Studio 2015-2026. Download the latest version from [Microsoft](https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170#latest-supported-redistributable-version).
* Debian/Ubuntu:
* [opencc-1.4.1-1-deb-amd64.zip](https://github.com/BYVoid/OpenCC/releases/download/ver.1.4.1/opencc-1.4.1-1-deb-amd64.zip)
* [opencc-1.4.1-1-deb-arm64.zip](https://github.com/BYVoid/OpenCC/releases/download/ver.1.4.1/opencc-1.4.1-1-deb-arm64.zip)
* [opencc-1.4.2-1-deb-amd64.zip](https://github.com/BYVoid/OpenCC/releases/download/ver.1.4.2/opencc-1.4.2-1-deb-amd64.zip)
* [opencc-1.4.2-1-deb-arm64.zip](https://github.com/BYVoid/OpenCC/releases/download/ver.1.4.2/opencc-1.4.2-1-deb-arm64.zip)
* Each zip bundles the `opencc`, `opencc-jieba`, and `libopencc*` deb packages for one architecture, with a `SHA256SUMS` file.

## Usage 使用
Expand Down Expand Up @@ -513,6 +515,33 @@ Apache License 2.0
- Optional dependency used by the experimental `opencc-jieba` plugin.
- 試驗性 `opencc-jieba` 插件使用的可選依賴。

## Code Signing 程式碼簽章

自 1.4.2 起,Windows 發佈的二進位檔(可攜式 CLI 壓縮包中的執行檔,以及 npm
win32-x64 套件中的 `opencc.node` 與 `opencc-jieba.dll`)皆經過 Authenticode
簽章。

Since 1.4.2, the Windows binaries — the executables in the portable CLI zip
and the `opencc.node` / `opencc-jieba.dll` shipped in the win32-x64 npm
packages — are Authenticode-signed.

This program uses free code signing provided by
[SignPath.io](https://about.signpath.io/), and a free code signing
certificate by the [SignPath Foundation](https://signpath.org/).

本項目使用 [SignPath.io](https://about.signpath.io/) 免費提供的程式碼簽章服務,
憑證由 [SignPath Foundation](https://signpath.org/) 免費提供。

* **Code signing policy 簽章政策**:只有合併進 `master` 的提交會被簽章,簽章請求
由 [維護者](#contributors-貢獻者)在發佈流程中透過 GitHub Actions 發起
(見 [`release-winget.yml`](.github/workflows/release-winget.yml) 與
[`release-npm-binaries.yml`](.github/workflows/release-npm-binaries.yml))。
* **Privacy policy 隱私政策**:OpenCC 為離線的文字轉換程式庫與命令列工具,除非
使用者、安裝者或操作者明確要求,否則不會將任何資訊傳輸至其他網路系統。
This program will not transfer any information to other networked systems
unless specifically requested by the user or the person installing or
operating it.

## Change History 版本歷史

* [NEWS](https://github.com/BYVoid/OpenCC/blob/master/NEWS.md)
Expand Down
2 changes: 1 addition & 1 deletion cmake/GitVersion.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

set(_OPENCC_FALLBACK_MAJOR 1)
set(_OPENCC_FALLBACK_MINOR 4)
set(_OPENCC_FALLBACK_REVISION 1)
set(_OPENCC_FALLBACK_REVISION 2)

find_package(Git QUIET)

Expand Down
2 changes: 1 addition & 1 deletion node/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ node_addon(
"//conditions:default": ["-std=c++20"],
}),
defines = [
'OPENCC_VERSION=\\"1.4.1\\"',
'OPENCC_VERSION=\\"1.4.2\\"',
"NAPI_DISABLE_CPP_EXCEPTIONS",
"Opencc_BUILT_AS_STATIC",
],
Expand Down
79 changes: 7 additions & 72 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "opencc",
"version": "1.4.1",
"version": "1.4.2",
"description": "Conversion between Traditional and Simplified Chinese",
"author": "Carbo Kuo <byvoid@byvoid.com>",
"license": "Apache-2.0",
Expand Down Expand Up @@ -74,10 +74,10 @@
"json-schema-to-typescript": "^15.0.4"
},
"optionalDependencies": {
"@opencc/opencc-darwin-arm64": "1.4.1",
"@opencc/opencc-darwin-x64": "1.4.1",
"@opencc/opencc-linux-arm64": "1.4.1",
"@opencc/opencc-linux-x64": "1.4.1",
"@opencc/opencc-win32-x64": "1.4.1"
"@opencc/opencc-darwin-arm64": "1.4.2",
"@opencc/opencc-darwin-x64": "1.4.2",
"@opencc/opencc-linux-arm64": "1.4.2",
"@opencc/opencc-linux-x64": "1.4.2",
"@opencc/opencc-win32-x64": "1.4.2"
}
}
Loading
Loading