Identification and conversion functions for Chinesetext processing
Project description
Dragon Mapper is a Python library that provides identification and conversion functions for Chinese text processing.
Convert between Chinese characters, Pinyin, Zhuyin, and the International Phonetic Alphabet.
Identify a string as Traditional or Simplified Chinese, Pinyin, Zhuyin, or the International Phonetic Alphabet.
>>> s = '我是一个美国人。'
>>> dragonmapper.hanzi.is_simplified(s)
True
>>> dragonmapper.hanzi.to_pinyin(s)
'wǒshìyīgèměiguórén。'
>>> dragonmapper.hanzi.to_pinyin(s, all_readings=True)
'[wǒ][shì/shi/tí][yī][gè/ge/gě/gàn][měi][guó][rén/ren]。'
>>> s = 'Wǒ shì yīgè měiguórén.'
>>> dragonmapper.transcriptions.is_pinyin(s)
True
>>> dragonmapper.transcriptions.pinyin_to_zhuyin(s)
'ㄨㄛˇ ㄕˋ ㄧ ㄍㄜˋ ㄇㄟˇ ㄍㄨㄛˊ ㄖㄣˊ.'
>>> dragonmapper.transcriptions.pinyin_to_ipa(s)
'wɔ˧˩˧ ʂɨ˥˩ i˥ kɤ˥˩ meɪ˧˩˧ kwɔ˧˥ ʐən˧˥.'
Install
Dragon Mapper supports Python 2.7 and 3. The only additional requirement is Zhon.
Just use pip:
$ pip install dragonmapper
Documentation
Dragon Mapper includes complete and easy-to-read documentation. Check it out for a gentle introduction or the full API details.
Bugs/Feature Requests
Dragon Mapper uses its GitHub Issues page to track bugs, feature requests, and support questions.
License
Dragon Mapper is released under the OSI-approved MIT License. See the file LICENSE.txt for more information.
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
File details
Details for the file dragonmapper-0.1.tar.gz
.
File metadata
- Download URL: dragonmapper-0.1.tar.gz
- Upload date:
- Size: 1.4 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1eab4913e349fd9886b4f8bfed5ef8270501a275feef375aeaabdf72152369ea |
|
MD5 | f091f4351fbfda9861e8df4cd59d77f9 |
|
BLAKE2b-256 | cd5aacbb8fccc4a12e65479e14d5f812fb7760680e8b832da8b351d1069d9b34 |