Skip to content

Commit

Permalink
(1)更新 Kong_Un.db ;(2)修訂 Excel 工作檔。
Browse files Browse the repository at this point in the history
  • Loading branch information
AlanJui committed Oct 27, 2024
1 parent 63a4457 commit 3867445
Show file tree
Hide file tree
Showing 8 changed files with 25,596 additions and 25,578 deletions.
Binary file modified Documents/廣韻/D300_廣韻_V6.xlsx
Binary file not shown.
51,060 changes: 25,530 additions & 25,530 deletions Documents/廣韻/廣韻漢字庫.csv

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions Documents/廣韻/技術指引.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ CREATE TABLE 廣韻漢字庫 (
FOREIGN KEY (
上字號
)
REFERENCES 切語上字表 (識別號)
REFERENCES 切語上字表 (識別號)
);
```

Expand Down Expand Up @@ -69,7 +69,7 @@ DELETE FROM 廣韻漢字庫;

```sql
.mode csv
.import /mnt/data/廣韻漢字庫.csv 廣韻漢字庫
.import ./Documents/廣韻/廣韻漢字庫.csv 廣韻漢字庫
```


Expand Down
Binary file added Documents/廣韻/資料庫工作檔V6.xlsx
Binary file not shown.
Binary file modified Kong_Un.db
Binary file not shown.
19 changes: 9 additions & 10 deletions a300_漢字查標音.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import sys

from mod_廣韻 import (
Cu_Hong_Im_Hu_Ho,
Kong_Un_Tng_Tai_Loo,
ca_siann_bu_piau_im,
ca_un_bu_piau_im,
Expand Down Expand Up @@ -33,15 +34,13 @@
下字 = record['下字']

# 顯示結果
print('\n=================================================')
print('\n=======================================')
print(f'查詢漢字:【{record["漢字"]}】(字號:{record["字號"]})')
print(f'切語:{上字}{下字}切')
print(f'標音:{record["標音"]}')
# print(f'字義:{record["字義"]}')

# 查詢反切上字
print('\n-------------------------------------------------')
print('【切語上字】:\n')
聲母 = record['聲母']
聲母標音 = record['聲母標音']
七聲類 = record['七聲類']
Expand All @@ -50,13 +49,12 @@
聲母其它標音 = ca_siann_bu_piau_im(cursor, 聲母標音)
聲母國際音標 = 聲母其它標音[0]['國際音標聲母']
聲母方音符號 = 聲母其它標音[0]['方音聲母']
print(f"切語上字 = {上字}")
print('\n---------------------------------------')
print(f'【切語上字】:{上字}\n')
print(f"聲母:{聲母} [{聲母標音}],國際音標:/{聲母國際音標}/,方音符號:{聲母方音符號}")
print(f"(發音部位:{七聲類},清濁:{清濁},發送收:{發送收})")

# 查詢反切下字
print('\n-------------------------------------------------')
print('【切語下字】:\n')
韻母 = record['韻母']
韻母標音 = record['韻母標音']
= record['攝']
Expand All @@ -69,7 +67,8 @@
韻母其它標音 = ca_un_bu_piau_im(cursor, 韻母標音)
韻母國際音標 = 韻母其它標音[0]['國際音標韻母']
韻母方音符號 = 韻母其它標音[0]['方音韻母']
print(f"切語下字 = {下字}")
print('\n---------------------------------------')
print(f"【切語下字】 = {下字}\n")
print(f"韻母:{韻母} [{韻母標音}],國際音標:/{韻母國際音標}/,方音符號:{韻母方音符號}")
print(f"攝:{},調:{調}聲,目次:{目次}")
print(f"韻目:{韻目}{}等,{}口 ({等呼})")
Expand All @@ -79,16 +78,16 @@
# 台羅聲調 = record['台羅聲調']
廣韻調名 = f'{清濁[-1]}{調}'
台羅聲調 = Kong_Un_Tng_Tai_Loo(廣韻調名)
print('\n-------------------------------------------------')
print('\n---------------------------------------')
print('【聲調】:上字辨【清濁】,下字定【四聲】。\n')
print(f' (1) 清濁:上字得【{清濁[-1]}】聲;')
print(f' (2) 四聲:下字得【{調}】聲調;')
print(f' (3) 台羅聲調:第【{台羅聲調}】調。')

print('\n-------------------------------------------------')
print('\n---------------------------------------')
print(f'【切語拼音】:\n')
print(f'台語音標:{聲母標音}{韻母標音}{台羅聲調}')
print(f'方音符號:{聲母方音符號}{韻母方音符號}{台羅聲調}\n')
print(f'方音符號:{聲母方音符號}{韻母方音符號}{Cu_Hong_Im_Hu_Ho(台羅聲調)}\n')

# 關閉資料庫連線
connection.close()
72 changes: 36 additions & 36 deletions a400_反切查拼音.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
import sys

from mod_廣韻 import (
Cu_Hong_Im_Hu_Ho,
Kong_Un_Tng_Tai_Loo,
ca_siann_bu_piau_im,
ca_un_bu_piau_im,
han_ji_ca_piau_im,
huan_ciat_ca_piau_im,
)

if __name__ == "__main__":
Expand Down Expand Up @@ -39,11 +39,11 @@
切語上字 = record["漢字"]

# 顯示結果
print('\n=================================================')
print('\n=======================================')
print(f'查詢切語:{ciat_gu}')

# 查詢反切上字
print('\n-------------------------------------------------')
print('\n---------------------------------------')
print(f'切語上字:【{record["漢字"]}】(字號:{record["字號"]})\n')
聲母 = record['聲母']
聲母標音 = record['聲母標音']
Expand All @@ -56,42 +56,42 @@
print(f"聲母:{聲母} [{聲母標音}],國際音標:/{聲母國際音標}/,方音符號:{聲母方音符號}")
print(f"(發音部位:{七聲類},清濁:{清濁},發送收:{發送收})")

切語下字 = han_ji_ca_piau_im(cursor, han_ji)
for record in 切語下字:
切語下字 = record["漢字"]
切語下字 = han_ji_ca_piau_im(cursor, han_ji)
for record in 切語下字:
切語下字 = record["漢字"]

# 查詢反切下字
print('\n-------------------------------------------------')
print(f'切語下字:【{record["漢字"]}】(字號:{record["字號"]})\n')
韻母 = record['韻母']
韻母標音 = record['韻母標音']
= record['攝']
調 = record['調']
目次 = record['目次']
韻目 = record['韻目']
= record['等']
= record['呼']
等呼 = record['等呼']
韻母其它標音 = ca_un_bu_piau_im(cursor, 韻母標音)
韻母國際音標 = 韻母其它標音[0]['國際音標韻母']
韻母方音符號 = 韻母其它標音[0]['方音韻母']
print(f"韻母:{韻母} [{韻母標音}],國際音標:/{韻母國際音標}/,方音符號:{韻母方音符號}")
print(f"攝:{},調:{調}聲,目次:{目次}")
print(f"韻目:{韻目}{}等,{}口 ({等呼})")
# 查詢反切下字
print('\n---------------------------------------')
print(f'切語下字:【{record["漢字"]}】(字號:{record["字號"]})\n')
韻母 = record['韻母']
韻母標音 = record['韻母標音']
= record['攝']
調 = record['調']
目次 = record['目次']
韻目 = record['韻目']
= record['等']
= record['呼']
等呼 = record['等呼']
韻母其它標音 = ca_un_bu_piau_im(cursor, 韻母標音)
韻母國際音標 = 韻母其它標音[0]['國際音標韻母']
韻母方音符號 = 韻母其它標音[0]['方音韻母']
print(f"韻母:{韻母} [{韻母標音}],國際音標:/{韻母國際音標}/,方音符號:{韻母方音符號}")
print(f"攝:{},調:{調}聲,目次:{目次}")
print(f"韻目:{韻目}{}等,{}口 ({等呼})")

# 組合拼音
廣韻調名 = f'{清濁[-1]}{調}'
台羅聲調 = Kong_Un_Tng_Tai_Loo(廣韻調名)
print('\n-------------------------------------------------')
print('聲調:上字辨【清濁】,下字定【四聲】。\n')
print(f' (1) 清濁:上字得【{清濁[-1]}】聲;')
print(f' (2) 四聲:下字得【{調}】聲調;')
print(f' (3) 台羅聲調:第【{台羅聲調}】調。')
# 組合拼音
廣韻調名 = f'{清濁[-1]}{調}'
台羅聲調 = Kong_Un_Tng_Tai_Loo(廣韻調名)
print('\n---------------------------------------')
print('聲調:上字辨【清濁】,下字定【四聲】。\n')
print(f' (1) 清濁:上字得【{清濁[-1]}】聲;')
print(f' (2) 四聲:下字得【{調}】聲調;')
print(f' (3) 台羅聲調:第【{台羅聲調}】調。')

print('\n-------------------------------------------------')
print(f'切語:{切語上字}{切語下字}切')
print(f'台語音標:{聲母標音}{韻母標音}{台羅聲調}')
print(f'方音符號:{聲母方音符號}{韻母方音符號}{台羅聲調}\n')
print('\n---------------------------------------')
print(f'切語:{切語上字}{切語下字}{聲母}{韻母}韻】')
print(f'台語音標:{聲母標音}{韻母標音}{台羅聲調}')
print(f'方音符號:{聲母方音符號}{韻母方音符號}{Cu_Hong_Im_Hu_Ho(台羅聲調)}\n')

# 關閉資料庫連線
connection.close()
19 changes: 19 additions & 0 deletions mod_廣韻.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,25 @@ def Kong_Un_Tng_Tai_Loo(廣韻調名):
return 調名對照.get(廣韻調名, None)


def Cu_Hong_Im_Hu_Ho(tai_lo_tiau_ho):
"""
取方音符號:將【台羅調號】轉換成【方音符號調號】
:param tai_lo_tiau_ho: 台羅調號
:return: 對應的方音符號調號
"""
方音符號調號 = {
1: '',
2: 'ˋ',
3: '˪',
4: '',
5: 'ˊ',
6: 'ˋ',
7: '˫',
8: '˙'
}
return 方音符號調號.get(tai_lo_tiau_ho, None)


# ==========================================================
# 自「台語音標+」,分析出:聲母、韻母、聲調
# ----------------------------------------------------------
Expand Down

0 comments on commit 3867445

Please sign in to comment.