Skip to content
Snippets Groups Projects
Commit 626f7635 authored by Haak, R. (Romeo)'s avatar Haak, R. (Romeo)
Browse files

Refactored the naming of the function and added the get_difference function...

Refactored the naming of the function and added the get_difference function again as it was necessary for data_comparer
parent 279581ed
No related branches found
No related tags found
2 merge requests!39Refactoring/master,!37Refactor/refactored strategies
......@@ -12,7 +12,7 @@ class Word:
return 1
def __eq__(self, word):
return self._word == word.get_word()
return self._word == word.word()
@property
def word(self):
......@@ -68,6 +68,15 @@ class Word:
"""
self._anchor = anchor
def get_difference(self, other):
"""Get the difference between the onset of this word and the other.
Args:
other: the other Word instance
"""
difference = self.onset - other.get_onset()
return difference
class ShadowWord(Word):
def __init__(self, word, onset, offset):
......@@ -135,6 +144,24 @@ class SourceWord(Word):
"""
self._shadowed = value
@property
def source(self):
"""Getter for the source attribute
Returns:
source: the word in the source file this word is aligned with
"""
return self.source
@source.setter
def source(self, source):
"""Set which word this one is aligned with
Args:
source: the source word that this word is set to be aligned with
"""
self.source = source
class Sentence:
def __init__(self, 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