Skip to content

Commit

Permalink
feat!: Remove field 字頭又作
Browse files Browse the repository at this point in the history
韓 & 脈 are now handled by Yitizi.
  • Loading branch information
syimyuzya committed Aug 30, 2024
1 parent 9372d37 commit 1f1c085
Show file tree
Hide file tree
Showing 3 changed files with 25,334 additions and 25,341 deletions.
12 changes: 3 additions & 9 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,6 @@ def main():
if 反切 == '無':
反切 = ''

字頭又作 = {
'𩏑': '韓',
'𧖴': '脈',
}.get(字頭, '')

釋義_key = (小韻號, 字頭)
if 釋義_key in 釋義補充_patch_from:
assert (
Expand All @@ -147,7 +142,6 @@ def main():
音韻地位,
反切,
字頭,
字頭又作,
釋義,
釋義補充,
],
Expand All @@ -162,16 +156,16 @@ def main():
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]]
assert not 條目[1][7], f'條目 already containing 釋義補充: {條目[1]}'
條目[1][7] = 釋義補充_patch_from[(patch[0], patch[1])][patch[2]]

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

last_原小韻號 = 0
小韻內字序 = 0
with open('韻書/廣韻.csv', 'w', newline='') as fout:
print(
'小韻號,小韻內字序,韻目原貌,音韻地位,反切,字頭,字頭又作,釋義,釋義補充',
'小韻號,小韻內字序,韻目原貌,音韻地位,反切,字頭,釋義,釋義補充',
file=fout,
)
for (原小韻號, _), row in 廣韻_data:
Expand Down
3 changes: 1 addition & 2 deletions check.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def contains_ascii(s: str):
with open('韻書/廣韻.csv') as f:
assert (
next(f).rstrip('\n')
== '小韻號,小韻內字序,韻目原貌,音韻地位,反切,字頭,字頭又作,釋義,釋義補充'
== '小韻號,小韻內字序,韻目原貌,音韻地位,反切,字頭,釋義,釋義補充'
)
for line in f:
(
Expand All @@ -32,7 +32,6 @@ def contains_ascii(s: str):
音韻地位描述,
反切,
字頭,
字頭又作,
釋義,
釋義補充,
) = line.rstrip('\n').split(',')
Expand Down
Loading

0 comments on commit 1f1c085

Please sign in to comment.