@@ -182,11 +182,12 @@ def handle_braille_keys(self, keyEvent):
182182 last_bopomofo = self .get_chewing_bopomofo_buffer ()
183183 if current_braille == '356' : # ['ㄧㄛ', 'ㄟ']
184184 # 上一個注音不是聲母 => ㄧㄛ, 否則 'ㄟ'
185- #if not last_bopomofo or not bopomofo_is_category(last_bopomofo[-1], "聲母"):
186- if not last_bopomofo :
187- bopomofo_seq = 'ㄧㄛ'
188- else :
185+ # 還需要檢查特例,上一個點字是 13 時,注音尚未確定,此時 last_bopomofo = None
186+ # 但有可能是ㄍ,可以接ㄟ,所以檢查上一個點字是否為 "13"
187+ if (last_bopomofo and bopomofo_is_category (last_bopomofo [- 1 ], "聲母" )) or self .last_braille == "13" :
189188 bopomofo_seq = 'ㄟ'
189+ else :
190+ bopomofo_seq = 'ㄧㄛ'
190191 elif current_braille == '1' : # ['ㄓ', '˙']
191192 # 沒有前一個注音,或前一個不是韻母 => ㄓ
192193 if not last_bopomofo or not bopomofo_is_category (last_bopomofo [- 1 ], "韻母" ):
@@ -208,7 +209,7 @@ def handle_braille_keys(self, keyEvent):
208209 last_bopomofo = {'13' : 'ㄍ' , '15' : 'ㄙ' , '245' : 'ㄘ' }.get (self .last_braille )
209210 bopomofo_seq = last_bopomofo + bopomofo_seq
210211 elif bopomofo_seq in ('ㄧ' , 'ㄩ' ) or (bopomofo_is_category (bopomofo_seq , "疊韻" ) and bopomofo_seq [0 ] in ('ㄧ' , 'ㄩ' )):
211- # ㄧ,ㄩ疊韻 或 ㄧ、、 ㄩ直接當韻母
212+ # ㄧ,ㄩ疊韻 或 ㄧ、ㄩ直接當韻母
212213 last_bopomofo = {'13' : 'ㄐ' , '15' : 'ㄒ' , '245' : 'ㄑ' }.get (self .last_braille )
213214 bopomofo_seq = last_bopomofo + bopomofo_seq
214215 else :
@@ -226,16 +227,16 @@ def handle_braille_keys(self, keyEvent):
226227 def toggleLanguageMode (self ):
227228 super ().toggleLanguageMode ()
228229 if self .chewingContext :
229- # 播放語音檔,說明目前是中文/英文
230+ # 播放語音檔,說明目前是中文/英文
230231 mode = self .chewingContext .get_ChiEngMode ()
231232 snd_file = os .path .join (self .sounds_dir , "chi.wav" if mode == CHINESE_MODE else "eng.wav" )
232233 winsound .PlaySound (snd_file , winsound .SND_FILENAME | winsound .SND_ASYNC )
233234
234- # 切換全形/半形
235+ # 切換全形/半形
235236 def toggleShapeMode (self ):
236237 super ().toggleShapeMode ()
237238 if self .chewingContext :
238- # 播放語音檔,說明目前是全形/半形
239+ # 播放語音檔,說明目前是全形/半形
239240 mode = self .chewingContext .get_ShapeMode ()
240241 snd_file = os .path .join (self .sounds_dir , "full.wav" if mode == FULLSHAPE_MODE else "half.wav" )
241242 winsound .PlaySound (snd_file , winsound .SND_FILENAME | winsound .SND_ASYNC )
0 commit comments