Fix errors in key normalization

This commit is contained in:
Thomas Scholtes 2014-04-12 17:51:22 +02:00
parent d014b802aa
commit 0f689d344a

View file

@ -184,9 +184,9 @@ class MusicalKey(String):
def parse(self, key):
key = key.lower()
for flat, sharp in self.ENHARMONIC:
re.sub(flat, sharp, key)
re.sub(r'[\W\s]+minor', 'm', key)
for flat, sharp in self.ENHARMONIC.items():
key = re.sub(flat, sharp, key)
key = re.sub(r'[\W\s]+minor', 'm', key)
return key.capitalize()
def normalize(self, key):