Install
openclaw skills install openccChinese character conversion between Simplified/Traditional and regional variants. Use when Pi needs to convert Chinese text with precision and awareness of...
openclaw skills install openccConvert Chinese text with precision using OpenCC (Open Chinese Convert).
import opencc
# Simplified → Traditional
converter = opencc.OpenCC('s2t.json')
result = converter.convert('汉字') # → 漢字
# Traditional → Simplified
converter = opencc.OpenCC('t2s.json')
result = converter.convert('漢字') # → 汉字
# Simplified → Taiwan Standard (正體)
converter = opencc.OpenCC('s2tw.json')
result = converter.convert('软件') # → 軟體
# Simplified → Hong Kong variant (繁體)
converter = opencc.OpenCC('s2hk.json')
result = converter.convert('软件') # → 軟件
| Config | Source | Target | Use Case |
|---|---|---|---|
s2t.json | Simplified | Traditional (OpenCC) | Generic traditional conversion |
t2s.json | Traditional | Simplified | Generic simplified conversion |
s2tw.json | Simplified | Taiwan Standard (正體) | Taiwan-specific terminology |
tw2s.json | Taiwan Standard | Simplified | Taiwan to Mainland |
s2hk.json | Simplified | Hong Kong (繁體) | Hong Kong variant |
hk2s.json | Hong Kong | Simplified | Hong Kong to Mainland |
s2twp.json | Simplified | Taiwan + idioms | Taiwan terminology + common phrases |
tw2sp.json | Taiwan | Simplified + idioms | Taiwan to Mainland with idioms |
t2tw.json | Traditional | Taiwan Standard | Standardize to Taiwan |
t2hk.json | Traditional | Hong Kong | Standardize to Hong Kong |
hk2t.json | Hong Kong | Traditional | Hong Kong to OpenCC standard |
t2jp.json | Traditional | Japanese Kanji (Shinjitai) | Convert to modern Japanese |
jp2t.json | Japanese | Traditional Chinese | Japanese to traditional Chinese |
tw2t.json | Taiwan Standard | Traditional | Taiwan to OpenCC standard |
s2t for traditional, t2s for simplifieds2tw for precise Taiwan terminology, s2twp for common phrasess2hk for Hong Kong variantt2jp for modern Japanese KanjiUse the included convert.py script:
# Command line conversion
python scripts/convert.py --source s2t "汉字转换"
# With stdin
echo "汉字转换" | python scripts/convert.py --source s2t
# Save to file
python scripts/convert.py --source s2t --input input.txt --output output.txt
# Using uv (recommended)
uv add opencc
# Or with pip
pip install opencc
See references/opencc_guide.md for:
scripts/convert.py — Python CLI wrapperreferences/opencc_guide.md — Detailed mode referencepyproject.toml — Python project configuration with uv