Pinyin Tone Convert
Easily convert pinyin tone numbers to tone marks.
Installation
npm install pinyin-tone-convert
Usage
const toneConvert = // 'Nǐ hǎo ma?' // Zhōngguórén ài hē chá háishi kāfēi?
Options
Under the hood this library uses pinyin-tone-parse
library and thus passes options
object directly to it. Look for all available options here.
const toneConvert =
Conversion Rules
This library works based on these rules:
a
ande
trump all other vowels and always take the tone mark.- In the combination
ou
,o
takes the mark. - In all other cases, the final vowel takes the mark.
Tests
npm test
License
MIT.