Skip to content

Commit

Permalink
[1603:1:7] #25: Codex._dictionaria_necessitatibus() MVP
Browse files Browse the repository at this point in the history
  • Loading branch information
fititnt committed Mar 15, 2022
1 parent 02fc78d commit cfc09bf
Showing 1 changed file with 26 additions and 6 deletions.
32 changes: 26 additions & 6 deletions officinam/999999999/0/1603_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,10 @@ def __init__(
self.auxilium_linguam = auxilium_linguam

self.archiva = []
self.m1603_1_1__de_codex = self._init_1603_1_1()
# self.m1603_1_1__de_codex = self._init_1603_1_1()
self.m1603_1_1__de_codex = None
self.m1603_1_1 = None
self._init_1603_1_1()
self.notitiae = DictionariaNotitiae()
self.dictionaria_linguarum = DictionariaLinguarum()
self.dictionaria_interlinguarum = DictionariaInterlinguarum()
Expand All @@ -514,15 +517,20 @@ def _init_1603_1_1(self):
fullpath = fullpath + '.no1.tm.hxl.csv'
# print('test', test, self.de_codex)
# print('fullpath', fullpath)
self.m1603_1_1 = {}
with open(fullpath) as csvfile:
reader = csv.DictReader(csvfile)
for lineam in reader:
self.m1603_1_1[lineam['#item+rem+i_qcc+is_zxxx+ix_n1603']] = \
lineam
if lineam['#item+rem+i_qcc+is_zxxx+ix_n1603'] \
== numerordinatio_neo_codex:
return lineam
# return lineam
self.m1603_1_1__de_codex = lineam

raise ValueError("{0} not defined on 1603_1_1 [{1}]".format(
self.de_codex, fullpath))
if not self.m1603_1_1__de_codex:
raise ValueError("{0} not defined on 1603_1_1 [{1}]".format(
self.de_codex, fullpath))

def _init_codex(self):
# numerordinatio = numerordinatio_neo_separatum(self.de_codex, ':')
Expand Down Expand Up @@ -586,7 +594,19 @@ def _dictionaria_necessitatibus(self, rem: dict, index: int = 1) -> list:
# 'Codex {0}; bad ix_codexfacto. No ||. [{1}]'.format(
# self.de_codex, str(temp_ix_codexfacto)))

paginae.append(str(rem))
clavem = temp_ix_codexfacto.replace('[', '').replace(']', '')

if clavem in self.m1603_1_1:
m1603_1_1_res = self.m1603_1_1[clavem]
else:
raise ValueError(
'ERROR: 1603_1_1 not have {0}'.format(temp_ix_codexfacto))

paginae.append('==== {0} {1}'.format(
temp_ix_codexfacto, m1603_1_1_res['#item+rem+i_mul+is_zyyy']))
# paginae.append(str(rem))
paginae.extend(self.res_explanationibus(m1603_1_1_res))
# paginae.append(str(m1603_1_1_res))
paginae.append('')
# parts = temp_ix_codexfacto.split('||')
# iri = parts[0]
Expand Down Expand Up @@ -1174,7 +1194,7 @@ def codex_praefatio(self) -> list:
referentia_textum = self.quod_res(
'0_1603_1_7_1_4_' + str(item))
if referentia_textum and len(referentia_textum) > 0:
# dictionaria_necessitatibus.extend(self._referencia(referentia_textum, index))

dictionaria_necessitatibus.extend(
self._dictionaria_necessitatibus(referentia_textum, index))

Expand Down

0 comments on commit cfc09bf

Please sign in to comment.