fix 5th tone bug

This commit is contained in:
Alicia Moore
2026-03-18 00:50:43 +08:00
parent a503c5148e
commit ae3958c8d2
2 changed files with 4 additions and 3 deletions

View File

@@ -1,11 +1,11 @@
# Mandarin Anki # Mandarin Anki
A janky way to generate anki cards for mandarin A janky card adder for ankiconnect and traditional chinese
## Dependencies ## Dependencies
* genanki
* wxpython * wxpython
* anki needs to be running with ankiconnect installed
## Running ## Running

View File

@@ -66,9 +66,10 @@ pinyinToneMarks = {
def convert_pinyin_callback(match): def convert_pinyin_callback(match):
tone= int(match.group(3)) tone= int(match.group(3))
vowel = match.group(1) vowel = match.group(1)
# the 5th tone is neutral # the 5th tone is neutral
if tone == 5: if tone == 5:
return match return match.group(0).replace('5', '')
# for multiple vowels, use first one if it is a/e/o, otherwise use second one # for multiple vowels, use first one if it is a/e/o, otherwise use second one
pos=0 pos=0