cjklib.reading.operator.MandarinIPAOperator is an implementation of a transcription of Standard Mandarin into the International Phonetic Alphabet (IPA).
Features:
Tones in IPA can be expressed using different schemes. The following schemes are implemented here:
Unlike other operators for Mandarin, distinction is made for six different tonal occurrences. The third tone is affected by tone sandhi and basically two different tone contours exist. Therefore getTonalEntity() and splitEntityTone() work with string representations as tones defined in TONES. Same behaviour as found in other operators for Mandarin can be achieved by simply using the first character of the given string:
>>> from cjklib.reading import operator
>>> ipaOp = operator.MandarinIPAOperator(toneMarkType='ipaToneBar')
>>> syllable, toneName = ipaOp.splitEntityTone(u'mən˧˥')
>>> tone = int(toneName[0])
The implemented schemes render tone information differently. Mapping might lose information so a full back-transformation can not be guaranteed.