All Projects → mozillazg → rust-pinyin

mozillazg / rust-pinyin

Licence: MIT License
汉字转拼音

Programming Languages

rust
11053 projects
shell
77523 projects

Projects that are alternatives of or similar to rust-pinyin

Python Pinyin
汉字转拼音(pypinyin)
Stars: ✭ 3,618 (+3159.46%)
Mutual labels:  pinyin, chinese, hanzi, hanzi-pinyin
hanzi-pinyin-font
Chinese font displaying Hanzi (汉字) characters with by transliteration/pronunciation (Pīnyīn).
Stars: ✭ 79 (-28.83%)
Mutual labels:  pinyin, chinese, hanzi
Hanbaobao
Mandarin Chinese text segmentation and mobile dictionary Android app (中文分词)
Stars: ✭ 17 (-84.68%)
Mutual labels:  pinyin, chinese
Go Pinyin
汉字转拼音
Stars: ✭ 907 (+717.12%)
Mutual labels:  pinyin, chinese
Somiao Pinyin
Somiao Pinyin: Train your own Chinese Input Method with Seq2seq Model 搜喵拼音输入法
Stars: ✭ 209 (+88.29%)
Mutual labels:  pinyin, chinese
Chineseutil
PHP 中文工具包,支持汉字转拼音、拼音分词、简繁互转、数字、金额大写;QQ群:17916227
Stars: ✭ 413 (+272.07%)
Mutual labels:  pinyin, chinese
Xpinyin
Translate Chinese hanzi to pinyin (拼音) by Python, 汉字转拼音
Stars: ✭ 709 (+538.74%)
Mutual labels:  pinyin, chinese
Gpy
Go 语言汉字转拼音工具
Stars: ✭ 136 (+22.52%)
Mutual labels:  pinyin, chinese
Pinyin
🇨🇳 汉字拼音 ➜ hàn zì pīn yīn
Stars: ✭ 6,047 (+5347.75%)
Mutual labels:  pinyin, chinese
pinyin data
🐼 Easy to use and portable pronunciation data for Hanzi characters.
Stars: ✭ 13 (-88.29%)
Mutual labels:  pinyin, chinese
anki-maobi
máobĭ (毛笔) is an Anki add-on to create cards with writing quizzes for Hanzi (Chinese characters)
Stars: ✭ 42 (-62.16%)
Mutual labels:  chinese, hanzi
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 (-35.14%)
Mutual labels:  pinyin, chinese
Cn sort
中文排序:按拼音/笔顺快速排序简体中文词组(百万数量级,可含中英/多音字)。如果对您有所帮助,欢迎点个star鼓励一下。
Stars: ✭ 102 (-8.11%)
Mutual labels:  pinyin, chinese
syng
A free, open source, cross-platform, Chinese-To-English dictionary for desktops.
Stars: ✭ 108 (-2.7%)
Mutual labels:  pinyin, chinese
pinyin4js
A opensource javascript library for converting chinese to pinyin。welcome Star : P
Stars: ✭ 153 (+37.84%)
Mutual labels:  pinyin, chinese
hkcs
香港民間字集 Hong Kong Character Set Project (HKCS)
Stars: ✭ 29 (-73.87%)
Mutual labels:  chinese, hanzi
mw2fcitx
Fcitx 5 pinyin dictionary generator for MediaWiki instances. (Releases for demo dict of zh.moegirl.org.cn)
Stars: ✭ 80 (-27.93%)
Mutual labels:  pinyin
PHPChineseToPinyin
请移步:
Stars: ✭ 40 (-63.96%)
Mutual labels:  pinyin
OpenDialog
An Open-Source Package for Chinese Open-domain Conversational Chatbot (中文闲聊对话系统,一键部署微信闲聊机器人)
Stars: ✭ 94 (-15.32%)
Mutual labels:  chinese
PaddleTokenizer
使用 PaddlePaddle 实现基于深度神经网络的中文分词引擎 | A DNN Chinese Tokenizer by Using PaddlePaddle
Stars: ✭ 14 (-87.39%)
Mutual labels:  chinese

rust-pinyin

Build Status Crates.io Version Doc

汉语拼音转换工具 Rust 版

Installation

Add this to your Cargo.toml:

[dependencies]
pinyin = "0.9"

Documentation

API documentation can be found here: https://docs.rs/pinyin/

Usage

use pinyin::{ToPinyin, ToPinyinMulti};

fn main() {
    let hans = "中国人";

    // 无声调,输出 zhong guo ren
    for pinyin in hans.to_pinyin() {
        if let Some(pinyin) = pinyin {
            print!("{} ", pinyin.plain());
        }
    }
    println!();

    // 包含声调,输出 zhōng guó rén
    for pinyin in hans.to_pinyin() {
        if let Some(pinyin) = pinyin {
            print!("{} ", pinyin.with_tone());
        }
    }
    println!();

    // 声调用数字表示,输出 zho1ng guo2 re2n
    for pinyin in hans.to_pinyin() {
        if let Some(pinyin) = pinyin {
            print!("{} ", pinyin.with_tone_num());
        }
    }
    println!();

    // 多音字,输出
    // zho1ng zho4ng
    // guo2
    // re2n
    for multi in hans.to_pinyin_multi() {
        if let Some(multi) = multi {
            for pinyin in multi {
                print!("{} ", pinyin.with_tone_num());
            }
            println!();
        }
    }
}

Build

$ cargo build

Test

$ cargo test

Data

使用来自 pinyin-data 的拼音数据。

Related Projects

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].