fixes genbopomofoheader.py
authorPeng Wu <alexepico@gmail.com>
Mon, 5 Dec 2011 03:55:58 +0000 (11:55 +0800)
committerPeng Wu <alexepico@gmail.com>
Mon, 5 Dec 2011 03:55:58 +0000 (11:55 +0800)
scripts/genbopomofoheader.py

index a609589..9d617b6 100644 (file)
@@ -31,11 +31,11 @@ bopomofo = [
     'ㄧ', 'ㄨ', 'ㄩ', 'ㄚ', 'ㄛ', 'ㄜ', 'ㄝ', 'ㄞ', 'ㄟ', 'ㄠ', 'ㄡ',
     'ㄢ', 'ㄣ', 'ㄤ', 'ㄥ', 'ㄦ',
 
-    'ˊ', 'ˇ', 'ˋ', '˙',
+    'Ë\89', 'Ë\8a', 'Ë\87', 'Ë\8b', 'Ë\99',
 ]
 
-#陰平聲不標號
-num_tones = -4
+#陰平聲不標號, use space key
+num_tones = -5
 
 bopomofo_keyboards = {
     #標準注音鍵盤
@@ -43,28 +43,28 @@ bopomofo_keyboards = {
     (
     "1","q","a","z","2","w","s","x","e","d","c","r","f","v","5","t","g","b","y","h","n",
     "u","j","m","8","i","k",",","9","o","l",".","0","p",";","/","-",
-    "6","3","4","7",
+    " ","6","3","4","7",
     ),
     #精業注音鍵盤
     'GINYIEH':
     (
     "2","w","s","x","3","e","d","c","r","f","v","t","g","b","6","y","h","n","u","j","m",
     "-","[","'","8","i","k",",","9","o","l",".","0","p",";","/","=",
-    "q","a","z","1",
+    " ","q","a","z","1",
     ),
     #倚天注音鍵盤
     'ETEN':
     (
     "b","p","m","f","d","t","n","l","v","k","h","g","7","c",",",".","/","j",";","'","s",
     "e","x","u","a","o","r","w","i","q","z","y","8","9","0","-","=",
-    "2","3","4","1",
+    " ","2","3","4","1",
     ),
     #IBM注音鍵盤
     'IBM':
     (
     "1","2","3","4","5","6","7","8","9","0","-","q","w","e","r","t","y","u","i","o","p",
     "a","s","d","f","g","h","j","k","l",";","z","x","c","v","b","n",
-    "m",",",".","/",
+    " ","m",",",".","/",
     ),
 }
 
@@ -98,7 +98,7 @@ def gen_chewing_tones(scheme):
     keyboard = bopomofo_keyboards[scheme]
     keyboard = keyboard[num_tones:]
     items = []
-    for (i, key) in enumerate(keyboard, start=2):
+    for (i, key) in enumerate(keyboard, start=1):
         items.append((key, i));
     items = sorted(items, key=itemgetter(0))
     entries = []