Skip to content

Latest commit

 

History

History
32 lines (24 loc) · 862 Bytes

README.md

File metadata and controls

32 lines (24 loc) · 862 Bytes

Pinyinizer

Adds proper (Mandarin) Chinese tone diacritics to a string.

The four tones of Chinese are commonly represented by the numbers 1-4. This module enables one to take a string with numerical tone representation and transforming it into a string with proper tone diacritics.

Numeric Tone Diacritic Description
ma1 level
ma2 rising
ma3 dipping
ma4 falling
ma ma neutral

Installation

dependencies:
  pinyinizer: 1.x #latest version
import 'package:pinyinizer/Pinyinizer.dart';

Usage

var pinyinizer = Pinyinizer();
pinyinizer.pinyinize("xie3 dian3er shen2me ba")
// return xiě diǎner shénme ba