Functions for converting between different representations of Hànyǔ Pīnyīn.
Worth noting:
Functions for converting between different representations of Hànyǔ Pīnyīn. Worth noting: - The neutral tone is represented as 0 or 5 (or left out) when using digits. - Like in many Pīnyīn input methods, a V is treated as a Ü. - The non-standard Pīnyīn M is supported (as found in e.g. cc-cedict). - The very common érhuà-style final R is supported as well.
(char->tone char-str)
Get the tone digit (0-4) based on a char-str
, presumably with a diacritic.
Get the tone digit (0-4) based on a `char-str`, presumably with a diacritic.
(diacritic-index syllable)
Get the index of syllable
where the Pinyin diacritic should be.
Derived from the guideline at: http://www.pinyin.info/rules/where.html
Get the index of `syllable` where the Pinyin diacritic should be. Derived from the guideline at: http://www.pinyin.info/rules/where.html
(diacritics->digits s)
Convert a Pinyin string s
with tone diacritics into one with tone digits.
Convert a Pinyin string `s` with tone diacritics into one with tone digits.
(digit->diacritic syllable)
Convert a syllable
with an affixed tone digit into one with a diacritic.
If converting more than a single syllable, use digits->diacritics instead!
Note: this function can also take Pinyin finals as input!
Convert a `syllable` with an affixed tone digit into one with a diacritic. If converting more than a single syllable, use digits->diacritics instead! Note: this function can also take Pinyin finals as input!
(digits->diacritics s & {:keys [v-as-umlaut?] :or {v-as-umlaut? false}})
Convert a Pinyin string s
with tone digits into one with tone diacritics.
Convert a Pinyin string `s` with tone digits into one with tone diacritics.
(no-diacritics s)
(no-diacritics s [[replacement match] & xs])
Remove Pinyin diacritics from the input string s
.
Remove Pinyin diacritics from the input string `s`.
(no-digits s)
Remove digits from the input string s
.
Remove digits from the input string `s`.
(with-diacritic tone char)
Get the diacriticised char
based on Pinyin tone
(0 through 5).
Get the diacriticised `char` based on Pinyin `tone` (0 through 5).
(with-umlaut s)
Replace the common substitute letter V in s
with the proper Pinyin Ü.
Replace the common substitute letter V in `s` with the proper Pinyin Ü.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close