Skip to main content
Python Software Foundation 20th Year Anniversary Fundraiser  Donate today!

This is a package to translate a chinese sentence into bopomofo letters

Project description


This is a package to translate a chinese sentence into bopomofo letters baesed on revised dictionary of Ministry of Education, segment corpus, artificial label data, and python package jieba and python-crfsuite.

>>> import bopomo
>>> sent = '妹妹背著洋娃娃,走到花園來看花。'
>>> bopomo_sent = bopomo.bopomo_sent(sent)
>>> print(bopomo_sent.bopomo_tag())
[['妹妹背著洋娃娃', 'ㄇㄟˋ ˙ㄇㄟ ㄅㄟ ˙ㄓㄜ ㄧㄤˊ ㄨㄚˊ ˙ㄨㄚ'], ['走到花園來看花', 'ㄗㄡˇ ㄉㄠˋ ㄏㄨㄚ ㄩㄢˊ ㄌㄞˊ ㄎㄢˋ ㄏㄨㄚ']]

>>> sent = '如果薪水不到4萬8,可向老闆說你給的薪水太低了。'
>>> bopomo_sent = bopomo.bopomo_sent(sent)
>>> print(bopomo_sent.bopomo_tag())
[['如果薪水不到4萬8', 'ㄖㄨˊ ㄍㄨㄛˇ ㄒㄧㄣ ㄕㄨㄟˇ ㄅㄨˋ ㄉㄠˋ 4 ㄨㄢˋ 8'], ['可向老闆說你給的薪水太低了', 'ㄎㄜˇ ㄒㄧㄤˋ ㄌㄠˇ ㄅㄢˇ ㄕㄨㄛ ㄋㄧˇ ㄍㄟˇ ˙ㄉㄜ ㄒㄧㄣ ㄕㄨㄟˇ ㄊㄞˋ ㄉㄧ ˙ㄌㄜ']]

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for bopomo, version 0.0.8
Filename, size File type Python version Upload date Hashes
Filename, size bopomo-0.0.8-py3-none-any.whl (3.3 MB) File type Wheel Python version py3 Upload date Hashes View
Filename, size bopomo-0.0.8.tar.gz (3.2 MB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page