Skip to content
Snippets Groups Projects
Commit 9b7de397 authored by Alfen, T. van (Tanja)'s avatar Alfen, T. van (Tanja)
Browse files

Merge branch 'SC-129/create-delay-output'

parents 16b272f1 f3af8b76
No related branches found
No related tags found
1 merge request!84Sc 129/create delay output
...@@ -82,6 +82,7 @@ class AnchorAlgorithm(AlignmentStrategy): ...@@ -82,6 +82,7 @@ class AnchorAlgorithm(AlignmentStrategy):
found = True found = True
competing_over = None competing_over = None
src_word.shadowed = True src_word.shadowed = True
src_word.shadow = shd_word
shd_word.correct = True shd_word.correct = True
shd_word.source = src_word shd_word.source = src_word
else: # If potential shadow is already flagged, store it else: # If potential shadow is already flagged, store it
...@@ -89,6 +90,7 @@ class AnchorAlgorithm(AlignmentStrategy): ...@@ -89,6 +90,7 @@ class AnchorAlgorithm(AlignmentStrategy):
# If true, then competing_over was wrongly flagged as correct: # If true, then competing_over was wrongly flagged as correct:
if competing_over is not None: if competing_over is not None:
competing_over.source.shadowed = False competing_over.source.shadowed = False
competing_over.source.shadow = None
competing_over.source = src_word # Shadow to new source word competing_over.source = src_word # Shadow to new source word
src_word.shadowed = True src_word.shadowed = True
......
...@@ -85,11 +85,8 @@ class Statistics: ...@@ -85,11 +85,8 @@ class Statistics:
# Now the results are from the Anchor algorithm analysis. # Now the results are from the Anchor algorithm analysis.
trial.results = self._mistake_counter.calculate_accuracy(source_em, trial.results = self._mistake_counter.calculate_accuracy(source_em,
shadow_em) shadow_em)
#IMPORTANT: This will not work on source_em because the matching is
# the other way around.
delays_per_word = [] delays_per_word = []
for source_word in source: for source_word in source_em:
if source_word.has_shadow(): if source_word.has_shadow():
delays_per_word.append([trial.participant, trial.condition, delays_per_word.append([trial.participant, trial.condition,
trial.video, source_word.word, trial.video, source_word.word,
......
...@@ -201,6 +201,7 @@ class SourceWord(Word): ...@@ -201,6 +201,7 @@ class SourceWord(Word):
def _set_anchor(self, anchor): def _set_anchor(self, anchor):
self._anchor = anchor self._anchor = anchor
self._shadow = anchor
@property @property
def shadow(self): def shadow(self):
...@@ -236,6 +237,7 @@ class SourceWord(Word): ...@@ -236,6 +237,7 @@ class SourceWord(Word):
""" """
return other.onset - self._onset return other.onset - self._onset
class Sentence(list): class Sentence(list):
def __init__(self, words): def __init__(self, words):
super().__init__(words) super().__init__(words)
......
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