pinyin-or-hanzi
TypeScript icon, indicating that this package has built-in type declarations

1.144.0 • Public • Published

Pinyin or Hanzi

npm version Travis Build Status dependency status dev dependency status ISC-licensed

Install

npm install pinyin-or-hanzi

Usage

import getType from 'pinyin-or-hanzi'

console.log(getType('wo3 de mao1 xi3huan3 he2 niu3nai3'))
// pinyin-numbered

console.log(getType('wǒ de māo xǐhuǎn hé niǔnǎi'))
// pinyin-marked

console.log(getType('ㄨㄛˇ ㄉㄜ˙ ㄇㄠ ㄒㄧˇ ㄏㄨㄢˇ ㄏㄜˊ ㄋㄧㄡˇ ㄋㄞˇ'))
// zhuyin

console.log(getType('我的猫喜欢喝牛奶'))
// mandarin

console.log(getType('this is not chinese at all!'))
// other

Related

Contributing

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

Package Sidebar

Install

npm i pinyin-or-hanzi

Weekly Downloads

16

Version

1.144.0

License

ISC

Unpacked Size

6.82 kB

Total Files

6

Last publish

Collaborators

  • pepebecker