Python implementation of StarCC
Project description
StarCC-Py
简繁转换 簡繁轉換 Python implementation of StarCC, the next generation of Simplified-Traditional Chinese conversion framework
安裝 Installation
pip install starcc
用法 Usage
不轉換用詞 Without phrase conversion:
from StarCC import PresetConversion
convert = PresetConversion(src='cn', dst='hk', with_phrase=False)
print(convert('为什么你在床里面睡着?我们的硅二极管坏了,要去老挝修理。'))
# 為什麼你在牀裏面睡着?我們的硅二極管壞了,要去老撾修理。
轉換用詞 With phrase conversion:
from StarCC import PresetConversion
convert = PresetConversion(src='cn', dst='tw', with_phrase=True)
print(convert('为什么你在床里面睡着?我们的硅二极管坏了,要去老挝修理。'))
# 為什麼你在床裡面睡著?我們的矽二極體壞了,要去寮國修理。
轉換模式一覽 Supported conversion modes
cn
: Simplified Chinese (Mainland China)hk
: Traditional Chinese (Hong Kong)tw
: Traditional Chinese (Taiwan)jp
: Japanese Shinjitai
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
starcc-0.0.2.tar.gz
(6.4 kB
view hashes)
Built Distribution
starcc-0.0.2-py3-none-any.whl
(478.1 kB
view hashes)