Skip to content

Commit

Permalink
!squash more
Browse files Browse the repository at this point in the history
  • Loading branch information
tony committed Jun 4, 2023
1 parent eec21cb commit a719335
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/unihan_db/importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,12 +261,15 @@ def import_char(

if "kGSR" in char:
for d in char["kGSR"]:
assert isinstance(d, dict)
k = kGSR(set=d["set"], letter=d["letter"], apostrophe=d["apostrophe"])
c.kGSR.append(k)

if "kCheungBauerIndex" in char:
d = char["kCheungBauerIndex"]
k = kCheungBauerIndex()
assert isinstance(d, dict)
assert isinstance(d["location"], dict)
k.locations.append(
UnhnLocation(
page=d["location"]["page"], character=d["location"]["character"]
Expand All @@ -275,11 +278,14 @@ def import_char(
c.kCheungBauerIndex.append(k)

if "kFennIndex" in char:
d = char["kFennIndex"]
_kFennIndex = char["kFennIndex"]
k = kFennIndex()
assert isinstance(_kFennIndex, dict)
assert isinstance(_kFennIndex["location"], dict)
k.locations.append(
UnhnLocation(
page=d["location"]["page"], character=d["location"]["character"]
page=_kFennIndex["location"]["page"],
character=_kFennIndex["location"]["character"],
)
)
c.kFennIndex.append(k)

0 comments on commit a719335

Please sign in to comment.