pinyin tone converter
Converts Mandarin pinyin with tone numbers to pinyin with tone marks.
how to use
To try out the converter, use the cli tool. This tool prompts the user to input numerical pinyin and returns pinyin with tone marks.
The main function 'convert_from_numerical_pinyin' is found in numerical_pinyin_converter.py. This function takes a numerical pinyin string ("bao1 guo3") as input and returns a converted string ("bāo guǒ").
from numerical_pinyin_converter import convert_from_numerical_pinyin convert_from_numerical_pinyin("bao1 guo3") # Returns bāo guǒ
what is pinyin
Pinyin is the most commonly used romanization system for Mandarin. Numerical pinyin is often used to avoid issues with utf8 encoding. Where utf8 encoding is not a concern, pinyin with tone marks is generally preferred.