Expand description
Dodo-zh is a crate which provide utilities method on pinyin and cedict file. It enables you to do the following operations
- Load cedict file from a given path with the keys either being in Simplified or Traditional Chinese
Doing several operations on a given pinyin such as:
- convert a pinyin to a zhuyin
- convert a pinyin to a wade giles
- convert a pinyin which has number tones e.g: wo3 to a pinyin with tone markers wǒ
- convert a pinyin with tones markers to numbers
- convert a simplified <-> traditional text
- detect chinese variant of a text
Modules§
Functions§
- convert_
pinyin_ accent_ to_ pinyin_ number - Convert a sequence of pinyin with accent into a pinyin with number
- convert_
pinyin_ to_ wade_ giles - Convert a sequence of pinyin into wade giles
- convert_
pinyin_ to_ zhuyin - Convert a sequence of pinyin with tone markers into zhuyin
- convert_
pinyin_ tone_ number_ to_ tone_ mark - Convert a sequence of pinyin with number to a pinyin tone mark
- convert_
text_ to_ desired_ variant - Convert a chinese text to a desired variant (simplified <-> tradtional)
- detect_
which_ variant - Detect which variant of chinese is the text. If the given path for the cedict dictionary is passed the detection will use the cedict. Otherwise it’ll try to do the detection through unicode. ⚠️ Unicode detection isn’t very accurate. It’s recommended to use the cedict dictionary for a precise detection.
- load_
cedict_ dictionary - Load Cedict Dictionary