Update: 初学记、佩文韵府 and 五车韵瑞
This commit is contained in:
21
佩文韵府/test_prefixes.py
Normal file
21
佩文韵府/test_prefixes.py
Normal file
@@ -0,0 +1,21 @@
|
||||
import json
|
||||
|
||||
with open('peiwenyunfu.json', 'r', encoding='utf-8') as f:
|
||||
data = json.load(f)
|
||||
|
||||
mismatches = []
|
||||
prefixes_found = set()
|
||||
|
||||
for rhyme, r_data in data.items():
|
||||
if rhyme in ["metadata", "preface"]:
|
||||
continue
|
||||
for word, content in r_data.get("词条", {}).items():
|
||||
pipe_count = content.count("丨")
|
||||
if pipe_count == 0:
|
||||
continue
|
||||
if pipe_count % len(word) != 0:
|
||||
mismatches.append((word, pipe_count))
|
||||
|
||||
print(f"Total mismatches: {len(mismatches)}")
|
||||
for w, p in mismatches[:20]:
|
||||
print(f"{w} (len {len(w)}), pipes: {p}")
|
||||
Reference in New Issue
Block a user