1.0.1 • Published 4 years ago

hz2py v1.0.1

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

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