From 433366d2eaba8042b5140b14bf63de53795a6570 Mon Sep 17 00:00:00 2001 From: Romain Goffe Date: Wed, 11 Jan 2012 18:13:05 +0100 Subject: [PATCH] Utils: correct regexp for removing spaces before punctuation symbols --- songs/Yodelice/Sunday_with_a_flu.sg | 2 +- utils/rules.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/songs/Yodelice/Sunday_with_a_flu.sg b/songs/Yodelice/Sunday_with_a_flu.sg index a6f06585..5be12685 100644 --- a/songs/Yodelice/Sunday_with_a_flu.sg +++ b/songs/Yodelice/Sunday_with_a_flu.sg @@ -41,7 +41,7 @@ \endverse \musicnote[english]{\Chorus; whistled verse; \Chorus} - \musicnote[french]{\Chorus ; couplet sifflé ; \Chorus} + \musicnote[french]{\Chorus; couplet sifflé; \Chorus} \beginverse Called a cabbage, threw the garbage diff --git a/utils/rules.py b/utils/rules.py index 0a7f8847..991fd3ba 100755 --- a/utils/rules.py +++ b/utils/rules.py @@ -139,13 +139,13 @@ for filename in songfiles: elif (re.compile("selectlanguage{english}").search(data)): #print "english song" #ensure no spaces before symbols ? ! ; : ) - data = re.sub("(?P\S)(?P[!?;:\)])","\g\g", data) + data = re.sub("(?P\S)\s(?P[!?;:\)])","\g\g", data) #ensure no spaces after symbols ( data = re.sub("(?P[\(])\s(?P\S)","\g\g", data) elif (re.compile("selectlanguage{spanish}").search(data)): #print "spanish song" #ensure no spaces before symbols ? ! ; : ) - data = re.sub("(?P\S)(?P[!?;:\)])","\g\g", data) + data = re.sub("(?P\S)\s(?P[!?;:\)])","\g\g", data) #ensure no spaces after symbols ¿ ¡ ( data = re.sub("(?P[¿¡\(])\s(?P\S)","\g\g", data) elif (re.compile("selectlanguage{portuguese}").search(data)):