diff --git a/mir_eval/chord.py b/mir_eval/chord.py index e54a1153..3b1cdb4a 100644 --- a/mir_eval/chord.py +++ b/mir_eval/chord.py @@ -344,7 +344,7 @@ def reduce_extended_quality(quality): # which is in turn derived from the context-free grammar of # Harte et al., 2005. CHORD_RE = re.compile( - r"""^((N|X)|(([A-G](b*|#*))((:(maj|min|dim|aug|1|5|sus2|sus4|maj6|min6|7|maj7|min7|dim7|hdim7|minmaj7|aug7|9|maj9|min9|11|maj11|min11|13|maj13|min13)(\((\*?((b*|#*)([1-9]|1[0-3]?))(,\*?((b*|#*)([1-9]|1[0-3]?)))*)\))?)|(:\((\*?((b*|#*)([1-9]|1[0-3]?))(,\*?((b*|#*)([1-9]|1[0-3]?)))*)\)))?((/((b*|#*)([1-9]|1[0-3]?)))?)?))$""" + r"""^((N|X)|(([A-G](b*|#*))((:(maj|min|dim|aug|1|5|sus2|sus4|maj6|min6|7|maj7|min7|dim7|hdim7|minmaj7|aug7|9|maj9|min9|b9|#9|11|#11|maj11|min11|13|maj13|min13|b13)(\((\*?((b*|#*)([1-9]|1[0-3]?))(,\*?((b*|#*)([1-9]|1[0-3]?)))*)\))?)|(:\((\*?((b*|#*)([1-9]|1[0-3]?))(,\*?((b*|#*)([1-9]|1[0-3]?)))*)\)))?((/((b*|#*)([1-9]|1[0-3]?)))?)?))$""" ) # nopep8 diff --git a/tests/test_chord.py b/tests/test_chord.py index 0e70cf97..402305de 100644 --- a/tests/test_chord.py +++ b/tests/test_chord.py @@ -638,3 +638,9 @@ def test_validate(): # Test that error is thrown on different-length labels with pytest.raises(ValueError): mir_eval.chord.validate([], ["C"]) + +# @maximoskp +# make testing for all chord types +# quals = mir_eval.chord.QUALITIES +# for q in quals.keys(): +# c = mir_eval.chord.encode('C' + (len(q) > 0)*':' + q, reduce_extended_chords=True) \ No newline at end of file