From: pin Date: Fri, 5 Feb 2010 20:17:44 +0000 (+0000) Subject: Ajout des tirets autours des syllabes. X-Git-Url: https://scm.cri.mines-paristech.fr/git/minwii.git/commitdiff_plain/1711aaae1c2b3397d739a0669df124e0534711b0?ds=inline Ajout des tirets autours des syllabes. git-svn-id: https://svn.cri.ensmp.fr/svn/minwii/trunk@9 fe552daf-6dbe-4428-90eb-1537e0879342 --- diff --git a/src/songs/musicxmltosong.py b/src/songs/musicxmltosong.py index 00903a1..1724fc4 100755 --- a/src/songs/musicxmltosong.py +++ b/src/songs/musicxmltosong.py @@ -138,13 +138,22 @@ class Note(object) : class Lyric(object) : + + _syllabicModifiers = { + 'single' : '%s', + 'begin' : '%s -', + 'middle' : '- %s -', + 'end' : '- %s' + } + def __init__(self, node) : self.node = node self.syllabic = _getNodeValue(node, 'syllabic', 'single') self.text = _getNodeValue(node, 'text') def __str__(self) : - return self.text.encode('utf-8') + text = self._syllabicModifiers[self.syllabic] % self.text + return text.encode('utf-8') __repr__ = __str__