Skip to content

Commit

Permalink
fix(釋義): missing 釋義補充 for 菱 & 䔖
Browse files Browse the repository at this point in the history
  • Loading branch information
syimyuzya committed Aug 30, 2024
1 parent 0f4a928 commit 9372d37
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
22 changes: 22 additions & 0 deletions build.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
import csv


# 「通俗地位」
音韻地位_patches = {
'892': ('幫二庚平', '幫二耕平'),
'1016': ('明一侯平', '明三C尤平'),
'3059': ('明一侯去', '明三C尤去'),
}
# 補全缺失釋義補充
釋義補充_patch_from = {
('949', '蔆'): None,
}
釋義補充_patch_to = {
('949', '菱'): ('949', '蔆', 0),
('949', '䔖'): ('949', '蔆', 0),
}


def process_音韻地位(row: list[str]) -> str:
Expand Down Expand Up @@ -121,6 +130,13 @@ def main():
'𧖴': '脈',
}.get(字頭, '')

釋義_key = (小韻號, 字頭)
if 釋義_key in 釋義補充_patch_from:
assert (
釋義補充_patch_from[釋義_key] is None
), f'duplicate (小韻號, 字頭): {釋義_key}'
釋義補充_patch_from[釋義_key] = (釋義, 釋義補充)

廣韻_data.append(
(
order_key,
Expand All @@ -143,6 +159,12 @@ def main():
diff = specified - cov
assert not diff, f'字頭 listed in 小韻細分_data but not seen: {"".join(sorted(diff))} (小韻 #{小韻號})'

for 條目 in 廣韻_data:
key = 條目[1][0], 條目[1][5]
if (patch := 釋義補充_patch_to.get(key)) is not None:
assert not 條目[1][8], f'條目 already containing 釋義補充: {條目[1]}'
條目[1][8] = 釋義補充_patch_from[(patch[0], patch[1])][patch[2]]

廣韻_data.sort(key=lambda x: x[0])

last_原小韻號 = 0
Expand Down
4 changes: 2 additions & 2 deletions 韻書/廣韻.csv
Original file line number Diff line number Diff line change
Expand Up @@ -8247,8 +8247,8 @@
949,5,蒸,來開三蒸平,力膺,凌,,冰凌,
949,6,蒸,來開三蒸平,力膺,𠗲,,上同,冰凌
949,7,蒸,來開三蒸平,力膺,蔆,,芰也,
949,8,蒸,來開三蒸平,力膺,菱,,,
949,9,蒸,來開三蒸平,力膺,䔖,,並同,
949,8,蒸,來開三蒸平,力膺,菱,,,芰也
949,9,蒸,來開三蒸平,力膺,䔖,,並同,芰也
949,10,蒸,來開三蒸平,力膺,㥄,,怜也,
949,11,蒸,來開三蒸平,力膺,鯪,,臨海風土記曰鯪魚腹背皆有刺如三角蔆也,
949,12,蒸,來開三蒸平,力膺,崚,,崚嶒山皃,
Expand Down

0 comments on commit 9372d37

Please sign in to comment.