Update: 初学记、佩文韵府 and 五车韵瑞

This commit is contained in:
denglifan
2026-03-22 16:18:35 +08:00
parent df475fd03f
commit 183b842090
553 changed files with 754048 additions and 169 deletions

View File

@@ -0,0 +1,28 @@
import json
print("Loading peiwenyunfu.json...")
with open('peiwenyunfu.json', 'r', encoding='utf-8') as f:
data = json.load(f)
current_vol = ""
fixed_count = 0
for rhyme, r_data in data.items():
if rhyme in ['metadata', 'preface']:
continue
vol = r_data.get("", "")
if vol.strip():
# Update current valid volume
current_vol = vol.strip()
else:
# If volume is empty, use the current_vol
if current_vol:
r_data[""] = current_vol
fixed_count += 1
print(f"Fixed {fixed_count} missing volumes.")
with open('peiwenyunfu.json', 'w', encoding='utf-8') as f:
json.dump(data, f, ensure_ascii=False, indent=4)
print("Saved to peiwenyunfu.json!")