JSPM

  • Created
  • Published
  • Downloads 109
  • Score
    100M100P100Q110327F
  • License MIT

Split up any kind of Pinyin into an array of syllables.

Package Exports

  • pinyin-split

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (pinyin-split) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Pinyin Split

npm version Travis Build Status Greenkeeper badge dependency status dev dependency status MIT-licensed chat on gitter

Install

npm install pinyin-split

Usage

const split = require('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', '?']

Contributing

If you have a question, found a bug or want to propose a feature, have a look at the issues page.