From 949a257866a00291b31e9aad434423b40303cf2a Mon Sep 17 00:00:00 2001 From: Date: Sun, 4 Sep 2011 18:02:51 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E6=B1=BA=E9=BC=BB=E9=9F=B3=E5=8A=A0?= =?UTF-8?q?=E8=AA=BF=E8=99=9F=E5=95=8F=E9=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- numbertomark.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/numbertomark.py b/numbertomark.py index 020de42..1f5e0a9 100755 --- a/numbertomark.py +++ b/numbertomark.py @@ -139,13 +139,15 @@ for i in range(len(syllable_list)): #轉換第二聲調值的鼻子音列表(ng不列)。 converted_nasal_cons_list = ['ḿ', 'ń', 'Ḿ', 'Ń'] - for i in nasal_cons_list: - if re.match(i, anal_syllable[2][0]): #比對頭子音 + for i in range(len(nasal_cons_list)): + #比對頭子音 + if re.match(nasal_cons_list[i], anal_syllable[2][0]): if len(anal_syllable) == 1: #m2, n2 - anal_syllable[2] = i + anal_syllable[2] = converted_nasal_cons_list[i] else: #ng2 - anal_syllable[2] = i + anal_syllable[2][1] + anal_syllable[2] = converted_nasal_cons_list[i] +\ + anal_syllable[2][1] break #以後的字母因為一定不合,不比了。 @@ -160,7 +162,7 @@ for i in range(len(syllable_list)): if len(anal_syllable[2]) == 1: #m5 or n5 anal_syllable[2] = anal_syllable[2] + '\xcc\x82' else: #ng5 - anal_syllable[2] = anal_syllablep[2][0] + '\xcc\x82' +\ + anal_syllable[2] = anal_syllable[2][0] + '\xcc\x82' +\ anal_syllable[2][1] #陽去和陽上(數字編號已轉換為7)