Skip to main content

Identification and conversion functions for Chinese text processing

Project description

https://badge.fury.io/py/dragonmapper.png https://travis-ci.org/tsroten/dragonmapper.png?branch=develop

Dragon Mapper is a Python library that provides identification and conversion functions for Chinese text processing.

Features

  • 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˧˥.'

Getting Started

Change Log

0.2.2 (2014-04-28)

  • Fixes a capitalization bug related to #5.

0.2.1 (2014-04-28)

  • Reformats README.rst.

  • Renames change log file to *.rst.

  • Adds authors and contributing files.

  • Sets up Travis CI.

  • Adds version to __init__.py.

  • Fixes #5. Make accented_to_numbered() add apostrophes when needed.

  • Fixes #4. Fixes numbered_to_accented() handling of 'v' vowel.

  • Fixes #3. Changes IndexError exception handlers to KeyError.

  • Fixes #2. Fixes accented_to_numbered() with uppercase accented vowel.

0.2.0 (2014-04-14)

  • Fixes typo in is_pinyin.

  • Adds is_pinyin_compatible() and is_zhuyin_compatible() functions.

  • Removes code for identifying Hanzi and incorporates Hanzi Identifier library.

  • Removes Sphinx viewcode extension.

  • Adds Python 3.4 environment to tox configuration.

  • Fixes typo in setup.py. Fixes #1.

0.1.0 (2014-02-17)

  • Initial release.

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

dragonmapper-0.2.2.tar.gz (1.4 MB view details)

Uploaded Source

Built Distribution

dragonmapper-0.2.2-py2.py3-none-any.whl (1.4 MB view details)

Uploaded Python 2 Python 3

File details

Details for the file dragonmapper-0.2.2.tar.gz.

File metadata

File hashes

Hashes for dragonmapper-0.2.2.tar.gz
Algorithm Hash digest
SHA256 b48730a894ab4bb8f434ce4de8c09847cfb8046bf9093dc918479f6f4c9c656a
MD5 e12c49c674e5ff1d9294d64972b563f9
BLAKE2b-256 220083c778180dfb1f46f0665a5276bfcae9107e2beb444814478c640abbd795

See more details on using hashes here.

File details

Details for the file dragonmapper-0.2.2-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for dragonmapper-0.2.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 57f089de6d8405bc1a969f6f54dfe2156cc878f6c18e92e14efaae28e6eca262
MD5 c7ade4921b45646e55810b4e778824fd
BLAKE2b-256 26352563a0d30a93423af12d0d213fe52607cd71808cbb6b38b336a36d79cebe

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page