diff --git a/umbra/mistake_finder.py b/umbra/mistake_finder.py index fe1f33a48033649bb52c49c755c50ba31af45114..1c8bb932f2e0fe16d060b03242379860917da290 100644 --- a/umbra/mistake_finder.py +++ b/umbra/mistake_finder.py @@ -25,13 +25,15 @@ class MistakeFinder: def _determine_mistake(self, index, word): if not self._check_repetition(word, index): # If not a repetition, - if not self._check_semantic_mistake(word): # semantic, - if not self._check_phonentic_mistake(word): # or phonetic, + #if not self._check_semantic_mistake(word): # semantic, + #if not self._check_phonentic_mistake(word): # or phonetic, # ... then shadow word is random: word.mistake = Mistake.RANDOM def _check_repetition(self, word, index): assert 0 <= index < len(self.shadow) + print(index) + # TODO: WordNet integration. Function below should be usable already! # def _check_semantic_mistake(self, shd_word): diff --git a/umbra/statistics.py b/umbra/statistics.py index 9e4727fb90beb57a53fdafa0af8ec3d9200593c7..3e72884d60c01df7c99b272f6bf42f023e0d6e61 100644 --- a/umbra/statistics.py +++ b/umbra/statistics.py @@ -53,8 +53,8 @@ class Statistics: print(f'source: {s_word.source} shadow: {s_word}') correctness = self._strategy.correctly_shadowed(source) # TODO: Make the mistake finding work with the statement below - # finder = MistakeFinder() - # finder.start(source_align_em, shadow_align_em) + finder = MistakeFinder() + finder.start(source_align_em, shadow_align_em) return source_align, shadow_align, correctness diff --git a/umbra/words.py b/umbra/words.py index 9a477d07d4926234e4e0bb86f23a24f10fd77b17..689fe325f5213955802d14c0f6bab75434e6a1a2 100644 --- a/umbra/words.py +++ b/umbra/words.py @@ -162,7 +162,7 @@ class ShadowWord(Word): """ assert self._correct is False assert mistake != Mistake.SKIPPED - self._mistake(mistake) + self._mistake = mistake class SourceWord(Word): @@ -195,7 +195,7 @@ class SourceWord(Word): mistake: Mistake Enum """ assert mistake != Mistake.RANDOM - self._mistake(mistake) + self._mistake = mistake class Sentence(list):