diff --git a/umbra/controller.py b/umbra/controller.py index dd629561dfae346178fd2d7c72cf7abcd702d1d8..c2c3ce4629153fef49eeec8424f40ad805d08961 100644 --- a/umbra/controller.py +++ b/umbra/controller.py @@ -173,17 +173,22 @@ class Controller: Extensible to consider "type". Now assume shadow files. """ - for file_path in self._shadow_files: - if "AO" not in file_path or ".csv" not in file_path: - # Very dirty - pass # TODO: raise error - elif type == "shadow": - dict = self._model.get_multi_data(type) - key = ut.shadow_regex(file_path) - data = self._filereader.read(file_path, type) - ut.add_to_dict(key, data, dict, alternative=True) - else: - dict = self._model.get_multi_data(type) - key = ut.id_regex(file_path) - data = self._filereader.read(file_path, type) - ut.add_to_dict(key, data, dict, alternative=True) + if type == "shadow": + for file_path in self._shadow_files: + if "AO" not in file_path or ".csv" not in file_path: + # Very dirty + pass # TODO: raise error + elif type == "shadow": + dict = self._model.get_multi_data(type) + key = ut.shadow_regex(file_path) + data = self._filereader.read(file_path, type) + ut.add_to_dict(key, data, dict, alternative=True) + else: + for file_path in self._source_files: + if ".csv" not in file_path: + pass + else: + dict = self._model.get_multi_data(type) + key = ut.id_regex(file_path) + data = self._filereader.read(file_path, type) + ut.add_to_dict(key, data, dict, alternative=True) diff --git a/umbra/mistake_finder.py b/umbra/mistake_finder.py index fb18835008b2d022fd28bbe0c43d7a7c055435c7..de514d2a4289956e48a43e759caca0d84193527b 100644 --- a/umbra/mistake_finder.py +++ b/umbra/mistake_finder.py @@ -134,7 +134,6 @@ class MistakeFinder: while chain and index-i > 1: diff += 1 i += 1 - print(i, index) chain = self._shadow[i].word == self._shadow[index+diff].word if chain: diff --git a/umbra/model.py b/umbra/model.py index 02807ba7262da72b98eaa2562aefcfb63b8dd78e..fa81fdf08a6421d63700850e2b4cfcc4b6fd3e55 100644 --- a/umbra/model.py +++ b/umbra/model.py @@ -133,11 +133,13 @@ class Model: for key, source in self._multi_data_source.items(): for key2, shadow in self._multi_data_shadow.items(): + if key == ut.filter_key(key2): + print([str(s) for s in source]) + print([str(s) for s in shadow]) result = self._stats.analyze(source, shadow) ut.add_to_dict(key+"_res", result, self._multi_results) - self._stats = Statistics(None) else: pass