22 lines
591 B
Python
22 lines
591 B
Python
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}")
|