diff --git a/.vscode/launch.json b/.vscode/launch.json index 9bd3b22..717e445 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -270,7 +270,7 @@ "program": "a320_廣韻_反切查標音.py", "console": "integratedTerminal", "args": [ - "烏候" + "余呂" ] }, { diff --git a/Ho_Lok_Ue.db b/Ho_Lok_Ue.db index 87308fa..eff7767 100644 Binary files a/Ho_Lok_Ue.db and b/Ho_Lok_Ue.db differ diff --git a/Kong_Un.db b/Kong_Un.db index 8f2e6a4..a8a9ffc 100644 Binary files a/Kong_Un.db and b/Kong_Un.db differ diff --git "a/a320_\345\273\243\351\237\273_\345\217\215\345\210\207\346\237\245\346\250\231\351\237\263.py" "b/a320_\345\273\243\351\237\273_\345\217\215\345\210\207\346\237\245\346\250\231\351\237\263.py" index f3ab43c..5f5e12d 100644 --- "a/a320_\345\273\243\351\237\273_\345\217\215\345\210\207\346\237\245\346\250\231\351\237\263.py" +++ "b/a320_\345\273\243\351\237\273_\345\217\215\345\210\207\346\237\245\346\250\231\351\237\263.py" @@ -27,7 +27,7 @@ print("反切用的切語,必須有兩個漢字!") sys.exit(-1) - siong_ji, han_ji = ciat_gu[0], ciat_gu[1] + siong_ji, ha_ji = ciat_gu[0], ciat_gu[1] # 建立資料庫連線 connection = sqlite3.connect('Kong_Un.db') @@ -36,6 +36,10 @@ os.system('cls') 切語上字 = han_ji_ca_piau_im(cursor, siong_ji) + if not 切語上字: + print(f"切語上字:【{siong_ji}】找不到,無法反切出讀音!") + sys.exit(-1) + for record in 切語上字: 切語上字 = record["漢字"] @@ -60,7 +64,12 @@ print(f"聲母:{聲母} [{聲母標音}],國際音標:/{聲母國際音標}/,方音符號:{聲母方音符號}") print(f"(發音部位:{七聲類},清濁:{清濁},發送收:{發送收})") - 切語下字 = han_ji_ca_piau_im(cursor, han_ji) + 切語下字 = han_ji_ca_piau_im(cursor, ha_ji) + if not 切語下字: + print('\n---------------------------------------') + print(f"切語下字:【{ha_ji}】找不到,無法反切出讀音!") + sys.exit(-1) + for record in 切語下字: 切語下字 = record["漢字"] diff --git "a/a701_\344\275\234\346\245\255\344\270\255\346\264\273\351\240\201\346\252\224\345\241\253\345\205\245\346\274\242\345\255\227.py" "b/a701_\344\275\234\346\245\255\344\270\255\346\264\273\351\240\201\346\252\224\345\241\253\345\205\245\346\274\242\345\255\227.py" index be8e214..9a1a3ff 100644 --- "a/a701_\344\275\234\346\245\255\344\270\255\346\264\273\351\240\201\346\252\224\345\241\253\345\205\245\346\274\242\345\255\227.py" +++ "b/a701_\344\275\234\346\245\255\344\270\255\346\264\273\351\240\201\346\252\224\345\241\253\345\205\245\346\274\242\345\255\227.py" @@ -4,6 +4,7 @@ import xlwings as xw +from p709_reset_han_ji_cells import reset_han_ji_cells from p710_thiam_han_ji import fill_hanji_in_cells # ========================================================================= @@ -34,8 +35,11 @@ print("無法執行,可能原因:(1) 未指定輸入檔案;(2) 未找到作用中的 Excel 工作簿") sys.exit(2) +# 將待注音的【漢字儲存格】,文字顏色重設為黑色(自動 RGB: 0, 0, 0);填漢顏色重設為無填滿 +reset_han_ji_cells(wb) + # 將待注音的漢字填入 -fill_hanji_in_cells(wb) +fill_hanji_in_cells(wb) # 將檔案存放路徑設為【專案根目錄】之下 try: @@ -49,9 +53,9 @@ ).strip() # 設定檔案輸出路徑,存於專案根目錄下的 output2 資料夾 -output_path = wb.names['OUTPUT_PATH'].refers_to_range.value +output_path = wb.names['OUTPUT_PATH'].refers_to_range.value new_file_path = os.path.join( - ".\\{0}".format(output_path), + ".\\{0}".format(output_path), f"【河洛話注音】{file_name}.xlsx") # 儲存新建立的工作簿 diff --git "a/a709_\351\207\215\347\275\256\346\274\242\345\255\227\345\204\262\345\255\230\346\240\274\347\224\250\350\211\262.py" "b/a709_\351\207\215\347\275\256\346\274\242\345\255\227\345\204\262\345\255\230\346\240\274\347\224\250\350\211\262.py" index 99372b0..a519253 100644 --- "a/a709_\351\207\215\347\275\256\346\274\242\345\255\227\345\204\262\345\255\230\346\240\274\347\224\250\350\211\262.py" +++ "b/a709_\351\207\215\347\275\256\346\274\242\345\255\227\345\204\262\345\255\230\346\240\274\347\224\250\350\211\262.py" @@ -34,7 +34,7 @@ print("無法執行,可能原因:(1) 未指定輸入檔案;(2) 未找到作用中的 Excel 工作簿") sys.exit(2) -# 將待注音的漢字填入 +# 將待注音的【漢字儲存格】,文字顏色重設為黑色(自動 RGB: 0, 0, 0);填漢顏色重設為無填滿 reset_han_ji_cells(wb) # 將檔案存放路徑設為【專案根目錄】之下 diff --git "a/output6/\343\200\220\346\262\263\346\264\233\350\251\261\346\263\250\351\237\263\343\200\221\343\200\212\346\241\203\350\212\261\345\234\222\350\250\230\343\200\213\343\200\220\346\262\263\346\264\233\347\231\275\350\251\261\351\237\263\343\200\221.xlsx" "b/output6/\343\200\220\346\262\263\346\264\233\350\251\261\346\263\250\351\237\263\343\200\221\343\200\212\346\241\203\350\212\261\345\234\222\350\250\230\343\200\213\343\200\220\346\262\263\346\264\233\347\231\275\350\251\261\351\237\263\343\200\221.xlsx" index 874f41b..bfd9535 100644 Binary files "a/output6/\343\200\220\346\262\263\346\264\233\350\251\261\346\263\250\351\237\263\343\200\221\343\200\212\346\241\203\350\212\261\345\234\222\350\250\230\343\200\213\343\200\220\346\262\263\346\264\233\347\231\275\350\251\261\351\237\263\343\200\221.xlsx" and "b/output6/\343\200\220\346\262\263\346\264\233\350\251\261\346\263\250\351\237\263\343\200\221\343\200\212\346\241\203\350\212\261\345\234\222\350\250\230\343\200\213\343\200\220\346\262\263\346\264\233\347\231\275\350\251\261\351\237\263\343\200\221.xlsx" differ