From ae3958c8d2746717a916bb182635d9202e22229e Mon Sep 17 00:00:00 2001 From: Alicia Moore Date: Wed, 18 Mar 2026 00:50:43 +0800 Subject: [PATCH] fix 5th tone bug --- README.md | 4 ++-- main.py | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 54da865..d8a0b65 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/main.py b/main.py index 299b71a..de0714b 100644 --- a/main.py +++ b/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