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

Removed duality from the Sentence class.

parent d3c6d677
No related branches found
No related tags found
1 merge request!46Sc 113/implement repetition mistakes
......@@ -43,6 +43,8 @@ class AnchorAlgorithm(AlignmentStrategy):
shd_index)
shd_last_anchor = self._shadow.index(word.anchor) + 1
src_last_anchor = src_index + 1
elif src_index == len(self._source):
print("TESTESTSETSET")
def _search_between_anchors(self, src_start, shd_start, src_end, shd_end):
"""Search for shadowed words between two anchored pairs of words.
......
......@@ -18,7 +18,7 @@ class MistakeFinder:
if not word.correct:
self._determine_mistake(index, word)
# Loop over the source:
for word in source:
for word in self.source:
if not word.shadowed and word.mistake is None:
# If not yet marked as mistake, then it is skipped:
word.mistake = Mistake.SKIPPED
......@@ -31,7 +31,7 @@ class MistakeFinder:
word.mistake = Mistake.RANDOM
def _check_repetition(self, word, index):
raise
assert 0 <= index < len(self.shadow)
# TODO: WordNet integration. Function below should be usable already!
# def _check_semantic_mistake(self, shd_word):
......
......@@ -200,14 +200,4 @@ class SourceWord(Word):
class Sentence(list):
def __init__(self, words):
list.__init__(self, words)
self.words = words # I am not sure if this is the 'proper' fix
def __str__(self):
return " ".join([str(w) for w in self.words])
def __len__(self):
return len(self.words)
def __iter__(self):
return iter(self.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