Skip to content
Snippets Groups Projects
Commit 014681cd authored by Vriezen, E.C. (Emma)'s avatar Vriezen, E.C. (Emma)
Browse files

Fixed mistake assignment in words.py and made the code runnable (aka commented...

Fixed mistake assignment in words.py and made the code runnable (aka commented out some things in mistake_finder.py)
parent 2a12a47d
No related branches found
No related tags found
1 merge request!46Sc 113/implement repetition mistakes
......@@ -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):
......
......@@ -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
......@@ -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):
......
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