Commit 6c37bb40 by hanhusheng

Update citationProcess.py。增加country初始化赋值,防止未找到时的报错

parent f999529f
...@@ -395,6 +395,7 @@ def citationProcess(config: dict): ...@@ -395,6 +395,7 @@ def citationProcess(config: dict):
countrys_list = result_dict.get("Countrys", []) countrys_list = result_dict.get("Countrys", [])
countrys = ";".join(countrys_list) if isinstance(countrys_list, list) else "" countrys = ";".join(countrys_list) if isinstance(countrys_list, list) else ""
# 翻译 countrys 为中文 # 翻译 countrys 为中文
translated_countrys = "not found"
if countrys: if countrys:
translated_countrys = translate_countries(countrys, config["model"], client) translated_countrys = translate_countries(countrys, config["model"], client)
sheet.cell(row=excel_row_idx, column=11, value=translated_countrys) # 第11列是中文国家名称 sheet.cell(row=excel_row_idx, column=11, value=translated_countrys) # 第11列是中文国家名称
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment