fix: 修复行缘、切分还原与语言解析并同步文档

保留逐字 margin/jiya.bias 字体后备方案;补齐 demo 重排、量测边界说明及共享规则 1.0.1 反例向量。

验证:完整构建通过,Node 376 项、WKWebView 64 项及原生 demo 9 项通过;Firefox 仍暂缓。
This commit is contained in:
2026-10-03 21:15:54 +08:00
parent 024ad5da93
commit 3a4fa1c932
33 changed files with 983 additions and 140 deletions
+9
View File
@@ -40,6 +40,15 @@ Unicode profile 另行記錄。更新 Unicode 範圍時,即使 JSON 結構不
字符覆寫固定為追加語義:不得經 override 移除或重分類內置字符。若未來需要破壞此
規則,屬 major 變更,須先作產品政策決策,不能由單一 adapter 私自實作。
## 1.0.1 語言契約澄清
`zh-explicit-script` 及 `zh-traditional-region` 指 [BCP 47 的 script/region 位置](https://www.rfc-editor.org/rfc/rfc5646.html#section-2.1),
不能從 extension/private-use 內容搜尋同名字串。Web 曾把 `zh-Hans-x-hant` 誤判成
繁體,現修正為簡體;空語言標籤歸 `other`。新增七個反例向量,既有 55 個向量結果、
字符集合、預設政策、schema 與 adapter 義務均未改,故依上述 patch 規則升為 1.0.1。
HTML 如何繼承 `lang` 是 Web adapter 契約,不寫入共享規則。未來 adapter 仍須通過
全部 62 個向量;本次未驗收其他 adapter。
## Adapter 邊界
字符集合一律以大寫十六進位 Unicode code point 的閉區間/單點表示;陣列須按起點
+43 -1
View File
@@ -1,7 +1,7 @@
{
"$schema": "./golden-vectors.schema.json",
"schemaVersion": 1,
"rulesetVersion": "1.0.0",
"rulesetVersion": "1.0.1",
"vectors": [
{
"id": "locale-ja",
@@ -63,6 +63,48 @@
"input": { "lang": "en" },
"expected": { "langClass": "other" }
},
{
"id": "locale-hans-private-hant",
"category": "language-classification",
"input": { "lang": "zh-Hans-x-hant" },
"expected": { "langClass": "zh-Hans" }
},
{
"id": "locale-tw-private-hans",
"category": "language-classification",
"input": { "lang": "zh-TW-x-hans" },
"expected": { "langClass": "zh-Hant" }
},
{
"id": "locale-latn-private-tw",
"category": "language-classification",
"input": { "lang": "zh-Latn-x-tw" },
"expected": { "langClass": "zh-Hans" }
},
{
"id": "locale-extension-hant",
"category": "language-classification",
"input": { "lang": "zh-CN-u-co-hant" },
"expected": { "langClass": "zh-Hans" }
},
{
"id": "locale-extlang-hans",
"category": "language-classification",
"input": { "lang": "zh-cmn-Hans-TW" },
"expected": { "langClass": "zh-Hans" }
},
{
"id": "locale-hant-cn",
"category": "language-classification",
"input": { "lang": "zh-Hant-CN" },
"expected": { "langClass": "zh-Hant" }
},
{
"id": "locale-empty",
"category": "language-classification",
"input": { "lang": "" },
"expected": { "langClass": "other" }
},
{
"id": "punct-stop",
"category": "punctuation-classification",
+1 -1
View File
@@ -1,7 +1,7 @@
{
"$schema": "./juzhen-rules.schema.json",
"schemaVersion": 1,
"rulesetVersion": "1.0.0",
"rulesetVersion": "1.0.1",
"unicodeProfile": {
"version": "17.0.0",
"coverage": "CJK Unified Ideographs through Extension J, compatibility ideographs, kana, bopomofo, radicals, and enclosed CJK characters"