Page MenuHomec4science

MeetingAnalyzerFactory.py
No OneTemporary

File Metadata

Created
Wed, Sep 18, 04:14

MeetingAnalyzerFactory.py

import os
from partlistproc.UppercaseAffiliationMeetingAnalyzer import UppercaseAffiliationMeetingAnalyzer as UpAnalyzer
from partlistproc.AffiliationListMeetingAnalyzer import AffiliationListMeetingAnalyzer as LiAnalyzer
from partlistproc.DigitalMeetingAnalyzer import DigitalMeetingAnalyzer as DiAnalyzer
import partlistproc.PdfExtractorFactory as Extr
class MeetingAnalyzerFactory():
# categories of the meetings to be analyzed
uppercase_affiliation_meetings = ["cop1", "cop2", "cop3", "cop4", "cop5",
"sb1", "sb2", "sb4", "sb5", "sb6", "sb7",
"sb10", "sb12", "sb13"]
list_affiliation_meetings = ["cop7", "cop8"] # need an affiliation list to proceed
def __init__(self, label, intermediate_name):
if not os.path.isfile(intermediate_name):
raise ValueError("The txt file for Analyzer does not exist")
self.label = label
self.intermediate_name = intermediate_name
def get_analyzer(self):
if self.label in self.uppercase_affiliation_meetings:
if self.label in Extr.PdfExtractorFactory.meetings_that_need_ocr:
return UpAnalyzer(self.intermediate_name)
else:
return UpAnalyzer(self.intermediate_name, encoding="utf-8")
elif self.label in self.list_affiliation_meetings:
return LiAnalyzer(self.intermediate_name)
else:
return DiAnalyzer(self.intermediate_name)

Event Timeline