|
|
|
@ -107,16 +107,6 @@ def _create_doc(folder: str)-> None:
|
|
|
|
for data in tqdm(infos_doc, desc="Populating Document..."):
|
|
|
|
for data in tqdm(infos_doc, desc="Populating Document..."):
|
|
|
|
Document.create(**data)
|
|
|
|
Document.create(**data)
|
|
|
|
|
|
|
|
|
|
|
|
def __find_transcribers(folder: str)-> None:
|
|
|
|
|
|
|
|
""""""
|
|
|
|
|
|
|
|
transcribers = []
|
|
|
|
|
|
|
|
for acte in sorted(os.listdir(folder)):
|
|
|
|
|
|
|
|
if acte.endswith(".xml"):
|
|
|
|
|
|
|
|
soup = make_soup(os.path.join(folder, acte))
|
|
|
|
|
|
|
|
transcriber = soup.fileDesc.titleStmt
|
|
|
|
|
|
|
|
for item in transcriber.find_all("respStmt"):
|
|
|
|
|
|
|
|
transcribers.append(item.find("name").text)
|
|
|
|
|
|
|
|
return set(transcribers)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def _create_agent(name_lst: list)-> None:
|
|
|
|
def _create_agent(name_lst: list)-> None:
|
|
|
|
"""create table agent"""
|
|
|
|
"""create table agent"""
|
|
|
|
@ -283,6 +273,26 @@ def _create_involved_in(folder: str):
|
|
|
|
for data in tqdm(princes_actes, desc="Populating involved_in..."):
|
|
|
|
for data in tqdm(princes_actes, desc="Populating involved_in..."):
|
|
|
|
Involved_in.create(**data)
|
|
|
|
Involved_in.create(**data)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def __find_transcribers(folder: str)-> None:
|
|
|
|
|
|
|
|
"""read all xml files in <folder>
|
|
|
|
|
|
|
|
and search for //teiHeader/fileDesc/titleStmt/respStmt/name
|
|
|
|
|
|
|
|
which contains name(s) of individual(s) respnsible(s)
|
|
|
|
|
|
|
|
for the act's trancription.
|
|
|
|
|
|
|
|
This function is used in init() function, all the names are
|
|
|
|
|
|
|
|
added to a list.
|
|
|
|
|
|
|
|
:param folder: name of a folder containing acts' xml file
|
|
|
|
|
|
|
|
:type folder: str
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
transcribers = []
|
|
|
|
|
|
|
|
for acte in sorted(os.listdir(folder)):
|
|
|
|
|
|
|
|
if acte.endswith(".xml"):
|
|
|
|
|
|
|
|
soup = make_soup(os.path.join(folder, acte))
|
|
|
|
|
|
|
|
transcriber = soup.fileDesc.titleStmt
|
|
|
|
|
|
|
|
for item in transcriber.find_all("respStmt"):
|
|
|
|
|
|
|
|
transcribers.append(item.find("name").text)
|
|
|
|
|
|
|
|
return set(transcribers)
|
|
|
|
|
|
|
|
|
|
|
|
def __csv_indiv_infos(indiv_type):
|
|
|
|
def __csv_indiv_infos(indiv_type):
|
|
|
|
"""extract individuals of the same type from static/csv/actors.csv
|
|
|
|
"""extract individuals of the same type from static/csv/actors.csv
|
|
|
|
and make a list with them
|
|
|
|
and make a list with them
|
|
|
|
|