Skip to content

Commit

Permalink
改善作業的處理細節。
Browse files Browse the repository at this point in the history
  • Loading branch information
AlanJui committed Oct 14, 2024
1 parent f5a249c commit 5d56c06
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
Binary file modified Tai_Loo_Han_Ji_Khoo.db
Binary file not shown.
18 changes: 9 additions & 9 deletions mod_台羅音標漢字庫.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,6 @@ def han_ji_ca_piau_im(cursor, han_ji, reading_type="文讀音"):
cursor.execute(query, (han_ji,))
results = cursor.fetchall()

# 定義【台羅音標】到【台語音標】的轉換規則
tai_luo_to_tai_gi_mapping = {
'tsh': 'c',
'ts': 'z'
}

# 將結果轉換為字典列表
fields = ['識別號', '漢字', '台語音標', '常用度', '摘要說明']

Expand All @@ -109,9 +103,6 @@ def han_ji_ca_piau_im(cursor, han_ji, reading_type="文讀音"):

# 將台羅音標轉換為台語音標
tai_gi_im = tai_loo_im
# for tai_luo, tai_gi in tai_luo_to_tai_gi_mapping.items():
# tai_gi_im = tai_gi_im.replace(tai_luo, tai_gi)

# 更新 row_dict 中的台語音標
row_dict['台語音標'] = tai_gi_im

Expand All @@ -128,6 +119,14 @@ def han_ji_ca_piau_im(cursor, han_ji, reading_type="文讀音"):

# ==========================================================
# 自「台語音標+」,分析出:聲母、韻母、聲調
# ----------------------------------------------------------
# 【台羅音標】到【台語音標】的轉換規則
# tai_loo_to_tai_gi_mapping = {
# 'tsh': 'c',
# 'ts': 'z'
# }
# for tai_loo, tai_gi in tai_loo_to_tai_gi_mapping.items():
# tai_gi_im = tai_gi_im.replace(tai_loo, tai_gi)
# ==========================================================
def split_zu_im(zu_im):
# 聲母相容性轉換處理(將 tsh 轉換為 c;將 ts 轉換為 z)
Expand Down Expand Up @@ -192,3 +191,4 @@ def split_zu_im(zu_im):

# 關閉資料庫連接
close_db_connection(conn)

Binary file not shown.
Binary file modified output2/【河洛話注音】蘭亭集序【白話音】.xlsx
Binary file not shown.

0 comments on commit 5d56c06

Please sign in to comment.