Skip to content
Snippets Groups Projects
Commit 02d0ec01 authored by Verbeek, J.M. (Janneke)'s avatar Verbeek, J.M. (Janneke) :speech_balloon:
Browse files

Fixed the error, turned out I'd been reading two shadow files and comparing those

parent e5bb770f
No related branches found
No related tags found
1 merge request!61Sc 145/multisource
...@@ -173,17 +173,22 @@ class Controller: ...@@ -173,17 +173,22 @@ class Controller:
Extensible to consider "type". Now assume shadow Extensible to consider "type". Now assume shadow
files. files.
""" """
for file_path in self._shadow_files: if type == "shadow":
if "AO" not in file_path or ".csv" not in file_path: for file_path in self._shadow_files:
# Very dirty if "AO" not in file_path or ".csv" not in file_path:
pass # TODO: raise error # Very dirty
elif type == "shadow": pass # TODO: raise error
dict = self._model.get_multi_data(type) elif type == "shadow":
key = ut.shadow_regex(file_path) dict = self._model.get_multi_data(type)
data = self._filereader.read(file_path, type) key = ut.shadow_regex(file_path)
ut.add_to_dict(key, data, dict, alternative=True) data = self._filereader.read(file_path, type)
else: ut.add_to_dict(key, data, dict, alternative=True)
dict = self._model.get_multi_data(type) else:
key = ut.id_regex(file_path) for file_path in self._source_files:
data = self._filereader.read(file_path, type) if ".csv" not in file_path:
ut.add_to_dict(key, data, dict, alternative=True) 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)
...@@ -134,7 +134,6 @@ class MistakeFinder: ...@@ -134,7 +134,6 @@ class MistakeFinder:
while chain and index-i > 1: while chain and index-i > 1:
diff += 1 diff += 1
i += 1 i += 1
print(i, index)
chain = self._shadow[i].word == self._shadow[index+diff].word chain = self._shadow[i].word == self._shadow[index+diff].word
if chain: if chain:
......
...@@ -133,11 +133,13 @@ class Model: ...@@ -133,11 +133,13 @@ class Model:
for key, source in self._multi_data_source.items(): for key, source in self._multi_data_source.items():
for key2, shadow in self._multi_data_shadow.items(): for key2, shadow in self._multi_data_shadow.items():
if key == ut.filter_key(key2): 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) result = self._stats.analyze(source, shadow)
ut.add_to_dict(key+"_res", ut.add_to_dict(key+"_res",
result, self._multi_results) result, self._multi_results)
self._stats = Statistics(None)
else: else:
pass pass
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment