From 8de0a025b599d7bb3140d553bad08e12708b0927 Mon Sep 17 00:00:00 2001 From: Carlos Galindo Date: Mon, 21 Nov 2022 19:49:54 +0100 Subject: [PATCH] espacios entre acordes consecutivos --- src/model.py | 5 +++++ 1 file changed, 5 insertions(+) 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