All Projects → lxneng → Xpinyin

lxneng / Xpinyin

Translate Chinese hanzi to pinyin (拼音) by Python, 汉字转拼音

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Xpinyin

Go Pinyin
汉字转拼音
Stars: ✭ 907 (+27.93%)
Mutual labels:  chinese, pinyin
hanzi-pinyin-font
Chinese font displaying Hanzi (汉字) characters with by transliteration/pronunciation (Pīnyīn).
Stars: ✭ 79 (-88.86%)
Mutual labels:  pinyin, chinese
Cn sort
中文排序:按拼音/笔顺快速排序简体中文词组(百万数量级,可含中英/多音字)。如果对您有所帮助,欢迎点个star鼓励一下。
Stars: ✭ 102 (-85.61%)
Mutual labels:  chinese, pinyin
Pinyin
🇨🇳 汉字拼音 ➜ hàn zì pīn yīn
Stars: ✭ 6,047 (+752.89%)
Mutual labels:  chinese, pinyin
syng
A free, open source, cross-platform, Chinese-To-English dictionary for desktops.
Stars: ✭ 108 (-84.77%)
Mutual labels:  pinyin, chinese
Hanbaobao
Mandarin Chinese text segmentation and mobile dictionary Android app (中文分词)
Stars: ✭ 17 (-97.6%)
Mutual labels:  chinese, pinyin
Somiao Pinyin
Somiao Pinyin: Train your own Chinese Input Method with Seq2seq Model 搜喵拼音输入法
Stars: ✭ 209 (-70.52%)
Mutual labels:  chinese, pinyin
Gpy
Go 语言汉字转拼音工具
Stars: ✭ 136 (-80.82%)
Mutual labels:  chinese, pinyin
pinyin4js
A opensource javascript library for converting chinese to pinyin。welcome Star : P
Stars: ✭ 153 (-78.42%)
Mutual labels:  pinyin, chinese
chinese-rhymer
轻量中文押韵神器,100%绝对可用,傻瓜式命令行操作,秒速实现烈焰单押,闪电双押,龙卷三押以及海啸式四押,目前版本 v0.2.6。Search for rhymes for Chinese words, with 1, 2, 3 and 4 characters, released on PyPI with current version of 0.2.6.
Stars: ✭ 72 (-89.84%)
Mutual labels:  pinyin, chinese
pinyin data
🐼 Easy to use and portable pronunciation data for Hanzi characters.
Stars: ✭ 13 (-98.17%)
Mutual labels:  pinyin, chinese
Python Pinyin
汉字转拼音(pypinyin)
Stars: ✭ 3,618 (+410.3%)
Mutual labels:  chinese, pinyin
rust-pinyin
汉字转拼音
Stars: ✭ 111 (-84.34%)
Mutual labels:  pinyin, chinese
Chineseutil
PHP 中文工具包,支持汉字转拼音、拼音分词、简繁互转、数字、金额大写;QQ群:17916227
Stars: ✭ 413 (-41.75%)
Mutual labels:  chinese, pinyin
Xmnlp
xmnlp:提供中文分词, 词性标注, 命名体识别,情感分析,文本纠错,文本转拼音,文本摘要,偏旁部首等功能
Stars: ✭ 591 (-16.64%)
Mutual labels:  pinyin
Phonetic
An iOS App to generate phonetic keys for your Chinese contacts. Written in Swift.
Stars: ✭ 574 (-19.04%)
Mutual labels:  chinese
Chrome Extension Udemy Translate
Translate Udemy's subtitles into Chinese、English etc(Disneyplus+netflix+udemy+lynda+hulu+hbo now+primevideo)
Stars: ✭ 553 (-22%)
Mutual labels:  chinese
How To Learn Robotics
开源机器人学学习指南
Stars: ✭ 701 (-1.13%)
Mutual labels:  chinese
Eda nlp for chinese
An implement of the paper of EDA for Chinese corpus.中文语料的EDA数据增强工具。NLP数据增强。论文阅读笔记。
Stars: ✭ 660 (-6.91%)
Mutual labels:  chinese
Translatorx
JetBrains 系列软件汉化包 关键字: Android Studio 3.5 汉化包 CLion 2019.3 汉化包 DataGrip 2019.3 汉化包 GoLand 2019.3 汉化包 IntelliJ IDEA 2019.3 汉化包 PhpStorm 2019.3 汉化包 PyCharm 2019.3 汉化包 Rider 2019.3 汉化包 RubyMine 2019.3 汉化包 WebStorm 2019.3 汉化包
Stars: ✭ 4,856 (+584.91%)
Mutual labels:  chinese

xpinyin

Translate Chinese hanzi to pinyin (拼音) by Python, 汉字转拼音

.. image:: https://github.com/lxneng/xpinyin/workflows/Tests/badge.svg :target: https://github.com/lxneng/xpinyin/actions?query=workflow%3ATests

.. image:: https://img.shields.io/travis/lxneng/xpinyin.svg :target: https://travis-ci.org/lxneng/xpinyin

.. image:: https://img.shields.io/pypi/v/xpinyin.svg :target: https://pypi.python.org/pypi/xpinyin/

.. image:: https://img.shields.io/pypi/dm/xpinyin.svg :target: https://pypi.python.org/pypi/xpinyin/

Install

Python version >= 3.6

.. code-block:: python

pip install -U xpinyin

Python version < 3.6

.. code-block:: python

pip install xpinyin==0.5.7

Usage

.. code-block:: python

>>> from xpinyin import Pinyin
>>> p = Pinyin()
>>> # default splitter is `-`
>>> p.get_pinyin("上海")
'shang-hai'
>>> # show tone marks
>>> p.get_pinyin("上海", tone_marks='marks')
'shàng-hǎi'
>>> p.get_pinyin("上海", tone_marks='numbers')
>>> 'shang4-hai3'
>>> # remove splitter
>>> p.get_pinyin("上海", '')
'shanghai'
>>> # set splitter as whitespace
>>> p.get_pinyin("上海", ' ')
'shang hai'
>>> p.get_initial("上")
'S'
>>> p.get_initials("上海")
'S-H'
>>> p.get_initials("上海", '')
'SH'
>>> p.get_initials("上海", ' ')
'S H'
>>> # get_initials with retroflex, #39
>>> p.get_initials("上海", splitter='-', with_retroflex=True)
'SH-H'
>>> # New in version 0.7.0, get combinations of the multiple readings of the characters
>>> p.get_pinyins('模型', splitter=' ', tone_marks='marks')
['mó xíng', 'mú xíng']
>>> p.get_pinyins('模样', splitter=' ', tone_marks='marks')
['mó yáng', 'mó yàng', 'mó xiàng', 'mú yáng', 'mú yàng', 'mú xiàng']
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].