Update: 初学记、佩文韵府 and 五车韵瑞
This commit is contained in:
14
佩文韵府/fix_final.py
Normal file
14
佩文韵府/fix_final.py
Normal file
@@ -0,0 +1,14 @@
|
||||
import json
|
||||
|
||||
with open('peiwenyunfu.json', 'r', encoding='utf-8') as f:
|
||||
data = json.load(f)
|
||||
|
||||
for rhyme, r_data in data.items():
|
||||
if rhyme in ["metadata", "preface"]: continue
|
||||
if "词条" in r_data:
|
||||
for word, content in r_data["词条"].items():
|
||||
if "丨" in content:
|
||||
r_data["词条"][word] = content.replace("丨", rhyme)
|
||||
|
||||
with open('peiwenyunfu.json', 'w', encoding='utf-8') as f:
|
||||
json.dump(data, f, ensure_ascii=False, indent=4)
|
||||
Reference in New Issue
Block a user