OpenCC made with Python
Project description
# 開放中文轉換(Pure Python)
Open Chinese convert (OpenCC) in pure Python.
## Introduction 簡介
[opencc-python](https://github.com/yichen0831/opencc-python) 是用純 Python 所寫,使用由 BYVoid(<byvoid.kcp@gmail.com>) 所開發的 [OpenCC](https://github.com/BYVoid/OpenCC) 中的字典檔案。 opencc-python 可以支援 Python2.7 及 Python3.x。
[opencc-python](https://github.com/yichen0831/opencc-python) is made by pure Python with the dictionary files of [OpenCC](https://github.com/BYVoid/OpenCC) which is developed by BYVoid(<byvoid.kcp@gmail.com>).
opencc-python can run with Python2.7 and Python3.x.
## Installation 安裝
將 opencc 這個目錄複製到你正在開發的專案中即可,或是執行(需要管理者權限):
`sh python setup.py install `
套件也可從 [PyPI](https://pypi.org/project/opencc-python-reimplemented/) 安裝,使用指令:
`sh pip install opencc-python-reimplemented `
Copy the opencc folder to your project, or run (admin required)
`sh python setup.py install `
The package can also be installed from [PyPI](https://pypi.org/project/opencc-python-reimplemented/) by issuing:
`sh pip install opencc-python-reimplemented `
## Usage 使用方式
` python from opencc import OpenCC cc = OpenCC('s2t') # convert from Simplified Chinese to Traditional Chinese # can also set conversion by calling set_conversion # cc.set_conversion('s2tw') to_convert = '开放中文转换' converted = cc.convert(to_convert) `
### Conversions 轉換
hk2s: Traditional Chinese (Hong Kong standard) to Simplified Chinese
s2hk: Simplified Chinese to Traditional Chinese (Hong Kong standard)
s2t: Simplified Chinese to Traditional Chinese
s2tw: Simplified Chinese to Traditional Chinese (Taiwan standard)
s2twp: Simplified Chinese to Traditional Chinese (Taiwan standard, with phrases)
t2hk: Traditional Chinese to Traditional Chinese (Hong Kong standard)
t2s: Traditional Chinese to Simplified Chinese
t2tw: Traditional Chinese to Traditional Chinese (Taiwan standard)
tw2s: Traditional Chinese (Taiwan standard) to Simplified Chinese
tw2sp: Traditional Chinese (Taiwan standard) to Simplified Chinese (with phrases)
## Issues 問題
當轉換有兩個以上的字詞可能時,程式只會使用第一個。
When there is more than one conversion available, only the first one is taken.
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
Built Distribution
Hashes for opencc-python-reimplemented-0.1.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 386090f52e8f1cc76bb5e86c2d2f67dc616ed24f8547bc5003f28af7604d2ec7 |
|
MD5 | 253d94599b6ab14382724592dff1c7b4 |
|
BLAKE2b-256 | 1d1a0b99dee887eff942045785e6308c780ae9cfef481519faf1548aa872a5f0 |
Hashes for opencc_python_reimplemented-0.1.4-py3.6.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9d8e1c231e6b0e18b0c05210d72963e705943d3b57e62f0b682dee0f84534ca6 |
|
MD5 | 7e49375970ff95d395bd9ce305ce0c2b |
|
BLAKE2b-256 | 9d695b3f0cc01701f337998b61e356a38f2d6c87c276eaabc7a99692ce645f3f |