summaryrefslogtreecommitdiffstats
path: root/intl/icu/source/data/translit/Latin_NumericPinyin.txt
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
commit36d22d82aa202bb199967e9512281e9a53db42c9 (patch)
tree105e8c98ddea1c1e4784a60a5a6410fa416be2de /intl/icu/source/data/translit/Latin_NumericPinyin.txt
parentInitial commit. (diff)
downloadfirefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz
firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip
Adding upstream version 115.7.0esr.upstream/115.7.0esrupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'intl/icu/source/data/translit/Latin_NumericPinyin.txt')
-rw-r--r--intl/icu/source/data/translit/Latin_NumericPinyin.txt36
1 files changed, 36 insertions, 0 deletions
diff --git a/intl/icu/source/data/translit/Latin_NumericPinyin.txt b/intl/icu/source/data/translit/Latin_NumericPinyin.txt
new file mode 100644
index 0000000000..9f832fcad4
--- /dev/null
+++ b/intl/icu/source/data/translit/Latin_NumericPinyin.txt
@@ -0,0 +1,36 @@
+# © 2016 and later: Unicode, Inc. and others.
+# License & terms of use: http://www.unicode.org/copyright.html
+# Generated using tools/cldr/cldr-to-icu/build-icu-data.xml
+#
+# File: Latin_NumericPinyin.txt
+# Generated from CLDR
+#
+
+# According to the pinyin definitions I've been able to find:
+# 'a', 'e' are the preferred bases
+# otherwise 'o'
+# otherwise last vowel
+# The trailing form of syllables are the following:
+# "a", "ai", "ao", "an", "ang",
+# "o", "ou", "ong",
+# "e", "ei", "er", "en", "eng",
+# "i", "ia", "iao", "ie", "iu", "ian", "in", "iang", "ing", "iong",
+# "u", "ua", "uo", "uai", "ui", "uan", "un", "uang", "ueng",
+# "ü", "üe", "üan", "ün"
+# so the letters the tone will 'hop' are:
+::NFD (NFC);
+$tone = [\u0304\u0301\u030C\u0300\u0306] ;
+# Move the tone to the end of a syllable, and convert to number
+e {($tone) r} → r &Pinyin-NumericPinyin($1);
+($tone) ( [i o n u {o n} {n g}]) → $2 &Pinyin-NumericPinyin($1);
+($tone) → &Pinyin-NumericPinyin($1);
+# The following backs up until it finds the right vowel, then deposits the tone
+$vowel = [aAeEiIoOuU {u\u0308} {U\u0308} vV];
+$consonant = [[a-z A-Z] - [$vowel]];
+$digit = [1-5];
+$1 &NumericPinyin-Pinyin($3) $2 ← ([aAeE]) ($vowel* $consonant*) ($digit);
+$1 &NumericPinyin-Pinyin($3) $2 ← ([oO]) ([$vowel-[aeAE]]* $consonant*) ($digit);
+$1 &NumericPinyin-Pinyin($3) $2 ← ($vowel) ($consonant*) ($digit);
+&NumericPinyin-Pinyin($1) ← [:letter:] {($digit)};
+::NFC (NFD);
+