X-Git-Url: https://svn.cri.ensmp.fr/git/minwii.git/blobdiff_plain/8d95e04bbc4a87d88159dd722260228157afe664..1711aaae1c2b3397d739a0669df124e0534711b0:/src/songs/musicxmltosong.py?ds=sidebyside 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__