fix 5th tone bug
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
# Mandarin Anki
|
||||
|
||||
A janky way to generate anki cards for mandarin
|
||||
A janky card adder for ankiconnect and traditional chinese
|
||||
|
||||
## Dependencies
|
||||
|
||||
* genanki
|
||||
* wxpython
|
||||
* anki needs to be running with ankiconnect installed
|
||||
|
||||
## Running
|
||||
|
||||
|
||||
3
main.py
3
main.py
@@ -66,9 +66,10 @@ pinyinToneMarks = {
|
||||
def convert_pinyin_callback(match):
|
||||
tone= int(match.group(3))
|
||||
vowel = match.group(1)
|
||||
|
||||
# the 5th tone is neutral
|
||||
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
|
||||
pos=0
|
||||
|
||||
Reference in New Issue
Block a user