Crates.io | rust-pinyin |
lib.rs | rust-pinyin |
version | 0.1.3 |
source | src |
created_at | 2021-09-02 09:53:42.542704 |
updated_at | 2023-11-22 07:33:54.110898 |
description | Change chinese sentence to pinyin initials |
homepage | |
repository | https://github.com/samlink/rust_pinyin |
max_upload_size | |
id | 445915 |
size | 24,743 |
Change chinese sentence to pinyin initials
将汉字转成拼音首字母,用于自动完成的快捷拼音输入
Add this to your Cargo.toml:
[dependencies]
rust-pinyin = "0.1"
use rust_pinyin::get_pinyin;
assert_eq!("zhq123vc", get_pinyin("张华强123vc"));
assert_eq!("bjyrysmyxgs", get_pinyin("北京益瑞盈商贸有限公司"));
assert_eq!("xnbjjsyxgs", get_pinyin("信念(北京)技术有限公司"));