JMult / hz2py

Transform Chinese characters into Chinese Pinyin. 汉字转拼音,可带声调.

Home Page:https://elvinzhu.github.io/hz2py/index.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

transform Chinese characters into Chinese Pinyin.

Build Status codecov

汉字转拼音,可带声调。 支持 20850 个汉字,不包含多音字。 压缩后体积 76K。

usage

import hz2py, { getInitials } from 'hz2py';

const test_words = '我爱我家';

hz2py(test_words); //  wo ai wo jia

hz2py(test_words, { tone: true }); //  wǒ ài wǒ jiā

hz2py(test_words, { delimiter: '' }); //  woaiwojia

getInitials(test_words); // ['w', 'a', 'w', 'j']

licence

MIT@elvinzhu

About

Transform Chinese characters into Chinese Pinyin. 汉字转拼音,可带声调.

https://elvinzhu.github.io/hz2py/index.html


Languages

Language:TypeScript 95.9%Language:JavaScript 4.1%