1.0.10 • Published 5 years ago

chinese-transform-pinyin v1.0.10

Weekly downloads
9
License
ISC
Repository
github
Last release
5 years ago

What Is It

It is a tool which you can input chinese, the tool can transform your input to pinyin. You will have a good time to use it.

npm install chinese-transform-pinyin

Thanks zhujun24 dictionary. It's very good

Have Three Options

  • firstChar only save the first char of the pinyin
  • onlyTone only save the tone of the pinyin
  • removeTone this option can transform the tone to the English char
  • keepOrigin save punctuation, number and English

You can use the three options together or only use the one of them, also you can choose any two options to use together.

For Example

import Pinyin from 'chinese-transform-pinyin'

Pinyin('拼音库第一次尝试') // pīn yīn kù dì yī cì cháng shì

or

import Pinyin from 'chinese-transform-pinyin'

Pinyin('拼音库第一次尝试', { removeTone: true }) // pin yin ku di yi ci chang shi

or

import Pinyin from 'chinese-transform-pinyin'

Pinyin('今天天气不错哟', { firstChar: true }) // j t t q b c y

also you can

import Pinyin from 'chinese-transform-pinyin'

Pinyin('今天天气不错哟', { firstChar: true, onlyTone: true }) // jī tā tā qì bù cò yō

now you can save any which except Chinese

Pinyin('今天天气不错,一起出去吧?', { keepOrigin: true }) // jīn tiān tiān qì bù cuò , yì qǐ chū qù ba?

Pinyin('拼音库第1次尝试', { keepOrigin: true }) // pīn yīn kù dì 1 cì cháng shì

A Tip

you may choose the firstChar option and the removeTone option to use together, but the result may be same when you use three options together, so I just recommend you to use three option together when you want to do this, because I do not make it happen in this version

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago