Mercurial > hg > syncopation-dataset
diff Syncopation models/rhythm_parser.py @ 35:3a878de00d19
made some small changes to files
author | csong <csong@eecs.qmul.ac.uk> |
---|---|
date | Mon, 13 Apr 2015 17:43:18 +0100 |
parents | 7a1730bbf15a |
children | cc38b3047ed9 |
line wrap: on
line diff
--- a/Syncopation models/rhythm_parser.py Sun Apr 12 23:52:08 2015 +0100 +++ b/Syncopation models/rhythm_parser.py Mon Apr 13 17:43:18 2015 +0100 @@ -1,5 +1,5 @@ ''' -Author: Chunyang Song +Authors: Chunyang Song, Christopher Harte Institution: Centre for Digital Music, Queen Mary University of London ''' @@ -19,15 +19,14 @@ line = line.replace(" ", '').replace("\t", '') return line -def extractInfo(line): - try: - if '{' not in line and '}' not in line: - raise RhythmSyntaxError(line) - else: - return line[line.find('{')+1 : line.find('}')] - except RhythmSyntaxError: - print 'Rhythmic information needs to be enclosed by "{" and "}"' - +# def extractInfo(line): +# try: +# if '{' not in line and '}' not in line: +# raise RhythmSyntaxError(line) +# else: +# return line[line.find('{')+1 : line.find('}')] +# except RhythmSyntaxError: +# print 'Rhythmic information needs to be enclosed by "{" and "}"' def read_rhythm(fileName): @@ -69,7 +68,7 @@ return barList def is_comment(line): - if discard_spaces(line)[0]=="#": + if discard_spaces(line)[0]==comment_sign: return True else: return False