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
10 changes: 5 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -304,15 +304,15 @@ npm 插件包位於 `plugins/jieba/node/`。若修改 npm integration,請同

2. **`s2tw.json`** - 簡體轉臺灣正體
- 使用 `STPhrases.txt`、`STCharacters.txt`
- 額外使用 `TWVariants.txt`
- 額外使用 `TWVariantsPhrases.txt`、`TWVariants.txt`

3. **`s2twp.json`** - 簡體轉臺灣正體(含慣用詞)
- 使用 `STPhrases.txt`、`STCharacters.txt`
- 額外使用 `TWPhrases.txt`、`TWVariants.txt`
- 額外使用 `TWPhrases.txt`、`TWVariantsPhrases.txt`、`TWVariants.txt`

4. **`s2hk.json`** - 簡體轉香港繁體
- 使用 `STPhrases.txt`、`STCharacters.txt`
- 額外使用 `HKVariants.txt`
- 額外使用 `HKVariantsPhrases.txt`、`HKVariants.txt`

### 測試建議

Expand All @@ -337,8 +337,8 @@ npm 插件包位於 `plugins/jieba/node/`。若修改 npm integration,請同

- **僅修改基本簡繁對應**:修改 `STCharacters.txt`,測試至少包含 `s2t`
- **修改詞組轉換**:修改 `STPhrases.txt`,測試包含 `s2t`、`s2tw`、`s2twp`、`s2hk`
- **臺灣特有用詞**:修改 `TWPhrases*.txt` 或 `TWVariants.txt`,測試包含 `s2tw`、`s2twp`
- **香港特有用詞**:修改 `HKVariants*.txt`,測試包含 `s2hk`
- **臺灣特有用詞**:修改 `TWPhrases*.txt` 或 `TWVariantsPhrases.txt`、`TWVariants.txt`,測試包含 `s2tw`、`s2twp`
- **香港特有用詞**:修改 `HKVariantsPhrases.txt`、`HKVariants*.txt`,測試包含 `s2hk`

## 提交變更

Expand Down
3 changes: 3 additions & 0 deletions data/dictionary/HKVariantsPhrases.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@
# License: Apache-2.0 (see LICENSE)
# Source: https://github.com/ByVoid/OpenCC
# Used in configs: s2hk.json, t2hk.json

喫茶小舖 喫茶小舖
純喫茶 純喫茶
2 changes: 2 additions & 0 deletions data/dictionary/STPhrases.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12782,6 +12782,7 @@ SQL注入攻击 SQL注入攻擊
吃板刀面 喫板刀麪
吃枪药 喫槍藥
吃烟 喫煙
吃茶小舖 喫茶小舖
吃药 喫藥
吃药前 喫藥前
吃药后 喫藥後
Expand Down Expand Up @@ -38210,6 +38211,7 @@ SQL注入攻击 SQL注入攻擊
纪念 紀念
纪念周 紀念週
纪里谷 紀里谷
纯吃茶 純喫茶
纯属巧合 純屬巧合
纯情蜡妹 純情蠟妹
纯朴 純樸
Expand Down
2 changes: 0 additions & 2 deletions data/dictionary/TWPhrases.txt
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ U盤 隨身碟
哈希 雜湊
哈薩克斯坦 哈薩克
哥斯達黎加 哥斯大黎加
喫茶小舖 喫茶小舖
喬治亞 喬治亞
單片機 微控制器
回調 回撥
Expand Down Expand Up @@ -449,7 +448,6 @@ U盤 隨身碟
紅心大戰 傷心小棧
納米 奈米
納米比亞 納米比亞
純喫茶 純喫茶
索馬里 索馬利亞
組件 元件
綁定 繫結
Expand Down
2 changes: 0 additions & 2 deletions data/dictionary/TWPhrasesRev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ SQL隱碼攻擊 SQL注入 SQL注入攻擊
哈薩克 哈薩克斯坦
哥斯大黎加 哥斯達黎加
啟用 激活
喫茶小舖 喫茶小舖
喬治亞 喬治亞 佐治亞 格魯吉亞
喬治亞共和國 格魯吉亞共和國
喬治亞州 佐治亞州
Expand Down Expand Up @@ -412,7 +411,6 @@ SQL隱碼攻擊 SQL注入 SQL注入攻擊
粘貼 粘貼
納米比亞 納米比亞
紐西蘭 新西蘭
純喫茶 純喫茶
索羅門群島 所羅門羣島
索馬利亞 索馬里
終端使用者 最終用戶
Expand Down
3 changes: 3 additions & 0 deletions data/dictionary/TWVariantsPhrases.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@
# License: Apache-2.0 (see LICENSE)
# Source: https://github.com/ByVoid/OpenCC
# Used in configs: s2tw.json, s2twp.json, t2tw.json

喫茶小舖 喫茶小舖
純喫茶 純喫茶
18 changes: 18 additions & 0 deletions test/testcases/testcases.json
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,24 @@
"t2s": "社群 索罗门群岛 核取方块 核取按钮"
}
},
{
"id": "BYVoid_OpenCC_PR_447_s2x",
"input": "拜访吃茶小舖和纯吃茶",
"expected": {
"s2t": "拜訪喫茶小舖和純喫茶",
"s2tw": "拜訪喫茶小舖和純喫茶",
"s2twp": "拜訪喫茶小舖和純喫茶",
"s2hk": "拜訪喫茶小舖和純喫茶"
}
},
{
"id": "BYVoid_OpenCC_PR_447_t2x",
"input": "拜訪喫茶小舖和純喫茶",
"expected": {
"t2tw": "拜訪喫茶小舖和純喫茶",
"t2hk": "拜訪喫茶小舖和純喫茶"
}
},
{
"id": "BYVoid_OpenCC_PR_1035_s2t",
"input": "想象 想象力 富于想象 想像水一样",
Expand Down
Loading