]> git.saurik.com Git - apple/icu.git/blame - icuSources/data/translit/Latin_NumericPinyin.txt
ICU-66108.tar.gz
[apple/icu.git] / icuSources / data / translit / Latin_NumericPinyin.txt
CommitLineData
f3c0d7a5
A
1# © 2016 and later: Unicode, Inc. and others.
2# License & terms of use: http://www.unicode.org/copyright.html#License
3#
73c04bcf 4# File: Latin_NumericPinyin.txt
f3c0d7a5 5# Generated from CLDR
73c04bcf 6#
2ca993e8
A
7
8# According to the pinyin definitions I've been able to find:
9# 'a', 'e' are the preferred bases
10# otherwise 'o'
11# otherwise last vowel
12# The trailing form of syllables are the following:
13# "a", "ai", "ao", "an", "ang",
14# "o", "ou", "ong",
15# "e", "ei", "er", "en", "eng",
16# "i", "ia", "iao", "ie", "iu", "ian", "in", "iang", "ing", "iong",
17# "u", "ua", "uo", "uai", "ui", "uan", "un", "uang", "ueng",
18# "ü", "üe", "üan", "ün"
19# so the letters the tone will 'hop' are:
374ca955
A
20::NFD (NFC);
21$tone = [\u0304\u0301\u030C\u0300\u0306] ;
2ca993e8 22# Move the tone to the end of a syllable, and convert to number
729e4ab9
A
23e {($tone) r} → r &Pinyin-NumericPinyin($1);
24($tone) ( [i o n u {o n} {n g}]) → $2 &Pinyin-NumericPinyin($1);
25($tone) → &Pinyin-NumericPinyin($1);
2ca993e8 26# The following backs up until it finds the right vowel, then deposits the tone
b331163b 27$vowel = [aAeEiIoOuU {u\u0308} {U\u0308} vV];
374ca955
A
28$consonant = [[a-z A-Z] - [$vowel]];
29$digit = [1-5];
729e4ab9
A
30$1 &NumericPinyin-Pinyin($3) $2 ← ([aAeE]) ($vowel* $consonant*) ($digit);
31$1 &NumericPinyin-Pinyin($3) $2 ← ([oO]) ([$vowel-[aeAE]]* $consonant*) ($digit);
32$1 &NumericPinyin-Pinyin($3) $2 ← ($vowel) ($consonant*) ($digit);
33&NumericPinyin-Pinyin($1) ← [:letter:] {($digit)};
374ca955 34::NFC (NFD);
2ca993e8 35