Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F88449415
MeetingAnalyzerFactory.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, Oct 18, 20:39
Size
1 KB
Mime Type
text/x-python
Expires
Sun, Oct 20, 20:39 (2 d)
Engine
blob
Format
Raw Data
Handle
21772701
Attached To
R10013 cop-mining-participants
MeetingAnalyzerFactory.py
View Options
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
Log In to Comment