Skip to main content

# opencc-python 開放中文轉換 Python

## OpenCC made with Python

## Introduction 簡介 opencc-python is made by Python with the dictionary files of [OpenCC](https://github.com/BYVoid/OpenCC) which is developed by BYVoid(<byvoid.kcp@gmail.com>).

opencc-python是用Python所寫, 使用由BYVoid(<byvoid.kcp@gmail.com>)所開發的[OpenCC](https://github.com/BYVoid/OpenCC)中的字典檔案.

opencc-python can run with Python2.7 and Python3.x

opencc-python可以支援Python2.7及Python3.x

## Installation 安裝 Just copy the opencc folder to the project you are developing.

把opencc這個目錄複製到你正在開發的專案中即可.

Or run (require administration privilege)或是執行(需要管理者權限):

python setup.py install

The package can also be instally from pypi by issuing:

套件也可從pypi安裝, 使用指令:

pip install opencc-python-reimplemented

## Usage 使用方式

from opencc import OpenCC

openCC = OpenCC(‘s2t’) # convert from Simplified Chinese to Traditional Chinese # can also set conversion by calling set_conversion # openCC.set_conversion(‘s2tw’) to_convert = ‘开放中文转换’ converted = openCC.convert(to_convert)

Conversions include 轉換包含:

‘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 are more than one conversion avaiable, only the first one is taken.

當轉換有兩個以上的字詞可能時, 程式只會使用第一個.

Release files for opencc-python-reimplemented 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for opencc-python-reimplemented 0.1.1
File Size Uploaded
opencc-python-reimplemented-0.1.1.tar.gz 484.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for opencc-python-reimplemented 0.1.1
File Interpreter ABI Platform
opencc_python_reimplemented-0.1.1-py3.6.egg Legacy Egg format - - Details

Total release size: 969.9 kB

Release files / opencc-python-reimplemented-0.1.1.tar.gz

Download URL opencc-python-reimplemented-0.1.1.tar.gz
Size 484.2 kB
Tags Source
SHA-256 checksum
How to use checksums
c1101ec5f38687170f7bee829fa915cec630d8ad8eace39fbfba0cd1bc585414
BLAKE2b-256 checksum
How to use checksums
faa3c27fb8f1d5a29bcb521b739499a386701df92bde0409e592566a28278976
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / opencc_python_reimplemented-0.1.1-py3.6.egg

Download URL opencc_python_reimplemented-0.1.1-py3.6.egg
Size 485.7 kB
Tags Egg
SHA-256 checksum
How to use checksums
a56c3866c998fc52462c426b5f406b2270c2d9fb1a9930bd61d607ab477173c0
BLAKE2b-256 checksum
How to use checksums
985718c204a4c62b49a8660eb36ebc4547e590ac8fe0687a6e1a29a8ec2fc598
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

This release

0.1.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page