Skip to content

Commit

Permalink
!squash
Browse files Browse the repository at this point in the history
  • Loading branch information
tony committed Jun 10, 2023
1 parent 740108c commit 733e81b
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/unihan_db/importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,13 +235,14 @@ def import_char(
("kRSKorean", kRSKorean, c.kRSKorean),
)

for f, model, column in rs_fields:
for f, Model, column in rs_fields:
if f in char:
for d in char[f]:
k = model(
radical=d["radical"],
strokes=d["strokes"],
simplified=d["simplified"],
for _md in char[f]:
assert isinstance(_md, dict)
k = Model(
radical=_md["radical"],
strokes=_md["strokes"],
simplified=_md["simplified"],
)
column.append(k)

Expand All @@ -259,9 +260,9 @@ def import_char(

for f, Model, column in irg_fields:
if f in char:
_md = char[f]
assert isinstance(_md, dict)
column.append(Model(source=_md["source"], location=_md["location"]))
_irg = char[f]
assert isinstance(_irg, dict)
column.append(Model(source=_irg["source"], location=_irg["location"]))

if "kGSR" in char:
for _kgsr in char["kGSR"]:
Expand Down

0 comments on commit 733e81b

Please sign in to comment.