diff --git a/src/model.py b/src/model.py index 6fddb26..6dc4d35 100644 --- a/src/model.py +++ b/src/model.py @@ -182,6 +182,8 @@ class Chord: ignore = False continue if "A" <= char <= "G": + if len(self.items) > 0 and not self.items[-1]['text'].endswith(" "): + self.items[-1]['text'] += " " if len(text) > i + 1 and (text[i + 1] == "#" or text[i + 1] == "&"): self.items.append({'text': chord_eng2lat(char + text[i + 1]), 'chord': True}) ignore = True @@ -189,6 +191,9 @@ class Chord: self.items.append({'text': chord_eng2lat(char), 'chord': True}) else: self.items.append({'text': char, 'chord': False}) + if len(self.items) > 0 and not self.items[-1]['text'].endswith(" "): + self.items[-1]['text'] += " " + def __str__(self): return self.text