Skip to content

Commit

Permalink
改善遇名稱未定義之狀況,未能以 try ... exception ... 捕捉例外狀況,以致問題發生時之特殊處理失效問題。
Browse files Browse the repository at this point in the history
  • Loading branch information
AlanJui committed Oct 14, 2024
1 parent 5d56c06 commit c884888
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 2 deletions.
Binary file modified Kong_Un_V2.db
Binary file not shown.
Binary file modified Tai_Loo_Han_Ji_Khoo.db
Binary file not shown.
6 changes: 4 additions & 2 deletions mod_台羅音標漢字庫.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,14 @@ def close_db_connection(conn):
# ==========================================================
def get_sound_type(wb):
try:
reading_type = wb.names['語音類型'].refers_to_range.value
if '語音類型' in wb.names:
reading_type = wb.names['語音類型'].refers_to_range.value
else:
raise KeyError
except KeyError:
reading_type = "文讀音"
return reading_type


# ==========================================================
# 用 `漢字` 查詢《台語音標》的讀音資訊
# 在【台羅音標漢字庫】資料表結構中,以【常用度】欄位之值,區分【文讀音】與【白話音】。
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit c884888

Please sign in to comment.