Skip to content

Commit a6d37f8

Browse files
committed
Add Chinese descriptions and examples to config files
- Add description_zh field with Traditional Chinese descriptions to all 14 config files - Add examples field with typical conversion examples for each config - Add config-examples.test.js to validate conversion examples - Examples demonstrate differences between variants (e.g., s2tw vs s2twp) Key updates: - s2t, t2s, hk2t, t2hk, t2tw, tw2t: Use 'OpenCC標準繁體' to clarify this is an intermediate standard format - jp2t, t2jp: Use Japanese-specific terms (財団法人, 桜花駅, 渋谷区, 図書館) to demonstrate Shinjitai ↔ Kyūjitai conversion - package.json: Update test script to run config-examples.test.js - dist/data/config/: Generated from data/config/ via npm run build Helper scripts (test infrastructure): - scripts/check-conversions.js: Verify conversion examples - scripts/find-variant-examples.js: Find variant examples All 101 tests passing.
1 parent a5231d4 commit a6d37f8

32 files changed

Lines changed: 280 additions & 19 deletions

wasm-lib/data/config/hk2s.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
{
22
"name": "Traditional Chinese (Hong Kong variant) to Simplified Chinese",
3+
"description_zh": "香港繁體到簡體",
4+
"examples": [
5+
{"input": "軟件", "output": "软件"},
6+
{"input": "資訊", "output": "资讯"},
7+
{"input": "", "output": ""}
8+
],
39
"segmentation": {
410
"type": "mmseg",
511
"dict": {
@@ -16,7 +22,7 @@
1622
}, {
1723
"type": "ocd2",
1824
"file": "HKVariantsRev.ocd2"
19-
}]
25+
}]
2026
}
2127
}, {
2228
"dict": {

wasm-lib/data/config/hk2t.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
{
2-
"name": "Traditional Chinese (Hong Kong variant) to Traditional Chinese",
2+
"name": "Traditional Chinese (Hong Kong variant) to Traditional Chinese (OpenCC Standard)",
3+
"description_zh": "香港繁體到OpenCC標準繁體",
4+
"examples": [
5+
{"input": "", "output": ""},
6+
{"input": "", "output": ""}
7+
],
38
"segmentation": {
49
"type": "mmseg",
510
"dict": {
@@ -16,7 +21,7 @@
1621
}, {
1722
"type": "ocd2",
1823
"file": "HKVariantsRev.ocd2"
19-
}]
24+
}]
2025
}
2126
}]
2227
}

wasm-lib/data/config/jp2t.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
{
22
"name": "New Japanese Kanji (Shinjitai) to Traditional Chinese Characters (Kyūjitai)",
3+
"description_zh": "日文新字體到繁體(舊字體)",
4+
"examples": [
5+
{"input": "財団法人", "output": "財團法人"},
6+
{"input": "桜花駅", "output": "櫻花驛"},
7+
{"input": "渋谷区", "output": "澀谷區"},
8+
{"input": "図書館", "output": "圖書館"}
9+
],
310
"segmentation": {
411
"type": "mmseg",
512
"dict": {

wasm-lib/data/config/s2hk.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
{
22
"name": "Simplified Chinese to Traditional Chinese (Hong Kong variant)",
3+
"description_zh": "簡體到香港繁體",
4+
"examples": [
5+
{"input": "鼠标", "output": "鼠標"},
6+
{"input": "软件", "output": "軟件"},
7+
{"input": "计算机", "output": "計算機"},
8+
{"input": "", "output": ""}
9+
],
310
"segmentation": {
411
"type": "mmseg",
512
"dict": {

wasm-lib/data/config/s2t.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
{
2-
"name": "Simplified Chinese to Traditional Chinese",
2+
"name": "Simplified Chinese to Traditional Chinese (OpenCC Standard)",
3+
"description_zh": "簡體到OpenCC標準繁體",
4+
"examples": [
5+
{"input": "鼠标", "output": "鼠標"},
6+
{"input": "计算机", "output": "計算機"},
7+
{"input": "软件", "output": "軟件"}
8+
],
39
"segmentation": {
410
"type": "mmseg",
511
"dict": {

wasm-lib/data/config/s2tw.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
{
22
"name": "Simplified Chinese to Traditional Chinese (Taiwan standard)",
3+
"description_zh": "簡體到台灣正體",
4+
"examples": [
5+
{"input": "鼠标", "output": "鼠標"},
6+
{"input": "计算机", "output": "計算機"},
7+
{"input": "软件", "output": "軟件"}
8+
],
39
"segmentation": {
410
"type": "mmseg",
511
"dict": {

wasm-lib/data/config/s2twp.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
{
22
"name": "Simplified Chinese to Traditional Chinese (Taiwan standard, with phrases)",
3+
"description_zh": "簡體到台灣正體(包含慣用詞轉換)",
4+
"examples": [
5+
{"input": "数据库", "output": "資料庫"},
6+
{"input": "软件", "output": "軟體"},
7+
{"input": "鼠标", "output": "滑鼠"},
8+
{"input": "网络", "output": "網路"}
9+
],
310
"segmentation": {
411
"type": "mmseg",
512
"dict": {

wasm-lib/data/config/t2hk.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
{
2-
"name": "Traditional Chinese to Traditional Chinese (Hong Kong variant)",
2+
"name": "Traditional Chinese (OpenCC Standard) to Traditional Chinese (Hong Kong variant)",
3+
"description_zh": "OpenCC標準繁體到香港繁體",
4+
"examples": [
5+
{"input": "", "output": ""},
6+
{"input": "", "output": ""}
7+
],
38
"segmentation": {
49
"type": "mmseg",
510
"dict": {

wasm-lib/data/config/t2jp.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
{
22
"name": "Traditional Chinese Characters (Kyūjitai) to New Japanese Kanji (Shinjitai)",
3+
"description_zh": "繁體(舊字體)到日文新字體",
4+
"examples": [
5+
{"input": "財團法人", "output": "財団法人"},
6+
{"input": "櫻花驛", "output": "桜花駅"},
7+
{"input": "澀谷區", "output": "渋谷区"},
8+
{"input": "圖書館", "output": "図書館"}
9+
],
310
"segmentation": {
411
"type": "mmseg",
512
"dict": {

wasm-lib/data/config/t2s.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
{
2-
"name": "Traditional Chinese to Simplified Chinese",
2+
"name": "Traditional Chinese (OpenCC Standard) to Simplified Chinese",
3+
"description_zh": "OpenCC標準繁體到簡體",
4+
"examples": [
5+
{"input": "鼠標", "output": "鼠标"},
6+
{"input": "計算機", "output": "计算机"},
7+
{"input": "軟件", "output": "软件"}
8+
],
39
"segmentation": {
410
"type": "mmseg",
511
"dict": {

0 commit comments

Comments
 (0)