123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- # %%
- import csv
- import json
- # %%
- # Import lems list + info files + authority files
- basedir = '/home/kora/Desktop/OVI_Data/Development/Parser/Data/'
- ovidir = 'DallOVI/'
- aspodir = 'DallASPO/'
- # datini OVI-ASPO lems, from OVI
- lems = json.load(open(basedir + ovidir + 'datiniXML/power_lemmarioB.json', 'r'))
- # datini people EAC, from ASPO
- with open(basedir + aspodir + 'data_eac_datini.csv') as infile:
- reader = csv.DictReader(infile)
- data_eac = [row for row in reader]
- # datini OVI-ASPO data, OVI side
- with open(basedir + 'FULL_MERGED.csv') as infile:
- reader = csv.DictReader(infile)
- datini_oviaspo_1 = [row for row in reader]
- # datini OVI-ASPO data, ASPO side
- with open(basedir + 'datini_ASPOOVI.csv') as infile:
- reader = csv.DictReader(infile)
- datini_oviaspo_2 = [row for row in reader]
- # %%
- iccio = list(filter(lambda el: el['lemma']['categoria']=='antr.' and el['lemma']['note'] != '' and el['lemma']['note'] != 'nome di famiglia', lems))
- # %%
- len(iccio)
- # %%
- datini_oviaspo_1[0].keys()
- # %%
- datini_oviaspo_2[0].keys()
- # %%
- data_eac[0].keys()
- # %%
- puppa = [ dict([(k, robba[k]) for k in ['mittente', 'destinatario']]) for robba in datini_oviaspo_1]
- # %%
- puppa
- # %%
- #######
- # TRY TO EXTRACT ALL PEOPLE-RELATED INFO FROM ALL FILES
- # FOR A GIVEN RANDOM LETTER
- print(len(iccio))
- for lem in iccio:
- print(lem['lemma']['note'])
- # %%
- aglio = list(filter(lambda el: el['lemma']['note']=='v. commento', iccio))
- print(aglio)
- # %%
|