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

Added functionality and removed a function that was repeated in source word,...

Added functionality and removed a function that was repeated in source word, but also inherited from word
parent e7fc17fd
No related branches found
No related tags found
1 merge request!43Sc 97/paired nw and tempfix reading
......@@ -106,7 +106,7 @@ class ShadowWord(Word):
"""Getter for Source attribute
Return:
The source.
The source word.
"""
return self._source
......@@ -119,12 +119,18 @@ class ShadowWord(Word):
"""
self._source = source
def has_source(self):
"""Check whether this word has a source word that it is matched with
Returns:
source: True if this word is matched, False otherwise.
"""
return self._source is not None
class SourceWord(Word):
def __init__(self, word, onset, offset):
super().__init__(word, onset, offset)
self._shadowed = False
self._source = None
@property
def shadowed(self):
......@@ -144,32 +150,6 @@ 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
def get_difference(self, other):
"""Get the difference between the onset of this word and the other.
Args:
other: the other Word instance
"""
return other.onset - self._onset
class Sentence(list):
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