Beispiel #1
0
 def RegInfo(self):
     reader = File()
     cleaner = Clean()
     filepath = Path(r'C:\Users\VSurfacePro3\Desktop\Degree Classes\Trade University\CTAI\R_looklook\results\PubTheatricalRegistration_info_allregistrations.csv')
     info_reg = reader.open_to_list_of_list(filepath)
     info_reg = cleaner.correct_Regerror(info_reg)
     return info_reg
Beispiel #2
0
 def import_records(self):
     file = File()
     filepath = Path(
         r'C:\Users\VSurfacePro3\Desktop\Degree Classes\Trade University\CTAI\R_looklook\results\Release_w_Reg.csv'
     )
     importedfile = file.open_to_list_of_list(filepath)
     importedfile = list(map(lambda x: x[0:8] + [eval(x[8])], importedfile))
     return importedfile
Beispiel #3
0
 def export(self, released_w_reg):
     file = File()
     filename = "Release_w_Reg"
     dir_root_results = "C:\\Users\\VSurfacePro3\\Desktop\\Degree Classes\\Trade University\\CTAI\\R_looklook\\results"
     file.write_to_cvs_wbk(released_w_reg, dir_root_results, filename)
     showtext = "Release_w_reg.csv exported, total number of records: " + str(
         len(released_w_reg)) + "."
     return showtext
Beispiel #4
0
 def export(self, released_w_reg_toreview, removeduplicates=False):
     unfolded = []
     for release in released_w_reg_toreview:
         if removeduplicates:
             rmdup = (map(lambda x: tuple(x), release[8]))
             rmdup = set(rmdup)
             release[8] = list(map(lambda x: list(x), rmdup))
         for reg in release[8]:
             unfolded += [release[0:8] + [reg]]
     file = File()
     filename = "released_w_reg_toreview"
     dir_root_wip = "C:\\Users\\VSurfacePro3\\Desktop\\Degree Classes\\Trade University\\CTAI\\R_looklook\\wip"
     file.write_to_cvs(unfolded, dir_root_wip, filename)
     showtext = ("Review file exported, number of records: " +
                 str(len(released_w_reg_toreview)) + ", unfolded to: " +
                 str(len(unfolded)) + ".")
     return showtext
Beispiel #5
0
 def import_reviewed(self, removeduplicates=False):
     file = File()
     filepath = Path(
         r'C:\Users\VSurfacePro3\Desktop\Degree Classes\Trade University\CTAI\R_looklook\wip\released_w_reg_toreview.csv'
     )
     importedfile = file.open_to_list_of_list(filepath)
     importedfile = list(map(lambda x: x[0:8] + [eval(x[8])], importedfile))
     wrapped = []
     i = 0
     while i < len(importedfile) - 1:
         reg_combined = []
         j = i + 1
         while j < len(importedfile):
             if importedfile[j][1:8] == importedfile[i][1:8]:
                 reg_combined += [importedfile[j][8]]
                 del importedfile[j]
                 j = j - 1
             j = j + 1
         reg_combined = [importedfile[i][8]] + reg_combined
         wrapped += [importedfile[i][0:8] + [reg_combined]]
         i = i + 1
     if removeduplicates:
         for each in wrapped[8]:
             remdup = tuple(map(lambda x: tuple(x), wrapped[8]))
             remdup = set(remdup)
             wrapped[8] = list(map(lambda x: list(x), remdup))
     return wrapped
     # =============================================================================
     #
     #         while index < len(importedfile)-1:
     #             if importedfile[index][0:8] == importedfile[index+1][0:8]:
     #                 wrapped += [importedfile[index][0:8] + [[importedfile[index][8]] + [importedfile[index+1][8]]]]
     #             index = index + 1
     # =============================================================================
     os.remove(filepath)  # delete reviewed file after import
     return wrapped
dir_path = "C:\\Users\\VSurfacePro3\\Desktop\\Degree Classes\\Trade University\\CTAI\\R_looklook\\results\\"
data_reg = pd.read_csv(dir_path +
                       'PubTheatricalRegistration_info_allregistrations.csv')
data_rel = pd.read_csv(dir_path + 'PubThreatricalRelease_info_allreleases.csv')
#%%

# %%
getter = MovieCN_RegtoRelease.Get()
matcher = MovieCN_RegtoRelease.Match()
filt = MovieCN_RegtoRelease.Filtering()
reviewer = MovieCN_RegtoRelease.Reviewer()
record = MovieCN_RegtoRelease.Record()
compare = MovieCN_RegtoRelease.Compare()

parser = MovieCN_Interpreter.Parse()
file = File()
#%%
list_allreleases = getter.headlessRelease()
list_allregs = getter.headlessReg()
#%%
released_w_regs_imported = record.import_records()  #2899
#%%
released_w_regs_now = released_w_regs_imported[:]  # 2899
unmatched_releases_now = filt.unmatched_releases(released_w_regs_imported,
                                                 list_allreleases)  #266
unmatched_releases_now1 = filt.unmatched_releases_asymmetric(
    list_allreleases, released_w_regs_imported)  # 261
unmatched_releases_now2 = filt.unmatched_releases_asymmetric(
    released_w_regs_imported, list_allreleases)  # 5
unmatched_reg_now = filt.unmatched_regs(released_w_regs_imported,
                                        list_allregs)  #20860
Beispiel #7
0
 def ReleaseInfo(self):
     reader = File()
     filepath = Path(r'C:\Users\VSurfacePro3\Desktop\Degree Classes\Trade University\CTAI\R_looklook\results\PubThreatricalRelease_info_allreleases.csv')
     all_releases = reader.open_to_list_of_list(filepath)
     return all_releases