Skip to content
Snippets Groups Projects

Sc 187/cleanup and docstrings

Closed Nijsen, T.J.P. (Thomas) requested to merge SC-187/cleanup-and_docstrings into review-window
Files
18
@@ -5,40 +5,15 @@ class AlignmentStrategy(ABC):
@abstractmethod
def __str__(self):
"""Provides a string representation of the AlignmentStrategy."""
"""Provide a String representation of the AlignmentStrategy."""
pass
@abstractmethod
def align(self, source, shadow):
"""Align the source and shadow Sentences.
"""Align a pair of source and shadow Sentences.
Args:
source: The Sentence of words in the source file
shadow: The Sentence of words in the shadow file
source: The Sentence of SourceWords
shadow: The Sentence of ShadowWords
"""
pass
@staticmethod
def correctly_shadowed(source_words):
"""Give a summary of the results.
Args:
source_words: The Sentence of Words in the source file
Returns:
total_words: Total number of Words to be shadowed
correct: Number of correctly shadowed Words
skipped: Number of Words skipped
"""
total_words = 0
correct = 0
skipped = 0
for source_word in source_words:
total_words += 1
if source_word.shadowed:
correct += 1
else:
skipped += 1
print('Total: {} | Correctly shadowed: {} | Skipped: {}'
.format(total_words, correct, skipped))
return total_words, correct, skipped
Loading