Skip to content

Commit

Permalink
!squash more
Browse files Browse the repository at this point in the history
  • Loading branch information
tony committed Jun 10, 2023
1 parent 3b504f1 commit a4548b7
Showing 1 changed file with 19 additions and 10 deletions.
29 changes: 19 additions & 10 deletions src/unihan_db/importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,19 +164,28 @@ def import_char(
)

if "kIICore" in char:
for d in char["kIICore"]:
k = kIICore(priority=d["priority"])
for s in d["sources"]:
k.sources.append(kIICoreSource(source=s))
c.kIICore.append(k)
for _kiic in char["kIICore"]:
k_sources: t.List[kIICoreSource] = []
assert isinstance(_kiic, dict)
assert isinstance(_kiic["sources"], list)
for _kiic_source in _kiic["sources"]:
k_sources.append(kIICoreSource(source=_kiic_source))
c.kIICore.append(kIICore(priority=_kiic["priority"], sources=k_sources))

if "kDaeJaweon" in char:
k = kDaeJaweon()
d = char["kDaeJaweon"]
k.locations.append(
UnhnLocation(page=d["page"], character=d["character"], virtual=d["virtual"])
_kdj = char["kDaeJaweon"]
assert isinstance(_kdj, dict)
c.kDaeJaweon.append(
kDaeJaweon(
locations=[
UnhnLocation(
page=_kdj["page"],
character=_kdj["character"],
virtual=_kdj["virtual"],
)
]
)
)
c.kDaeJaweon.append(k)

if "kIRGKangXi" in char:
_kikx_locations: t.List[UnhnLocation] = []
Expand Down

0 comments on commit a4548b7

Please sign in to comment.