Pinyin Split
Install
npm install pinyin-split
Usage
import split from 'pinyin-split'
console.log(split('本:wodemaoxihuanheniunai!'))
// ['wo', 'de', 'mao', 'xi', 'huan', 'he', 'niu', 'nai']
console.log(split('本:wo de mao xihuan he niunai!'))
// ['wo', 'de', 'mao', 'xi', 'huan', 'he', 'niu', 'nai']
// return everything and wrap pinyin into lists
console.log(split('本:ni jiao shenme mingzi?', true, true))
// ['本:'['ni'], ' ', ['jiao'], ' ', ['shen'], ['me'], ' ', ['ming'], ['zi'], '?']
// return everything and don't wrap pinyin into lists
console.log(split('Nǐ huì shuō Yīngwén ma?', true))
// ['Nǐ', ' ', 'huì', ' ', 'shuō', ' ', 'Yīng', 'wén', ' ', 'ma', '?']
Related
pinyin-utils
find-hanzi
hsk-words
cedict
mdbg
pinyin-or-hanzi
hanzi-to-pinyin
pinyin-convert
pinyin-rest
pinyin-api
pinyin-bot-core
pinyin-telegram
pinyin-messenger
pinyin-line
pinyin-chrome
pinyin-cli
hanzi-cli
Contributing
If you have a question, found a bug or want to propose a feature, have a look at the issues page.