>>>>> "Juergen" == Juergen Reuter <[EMAIL PROTECTED]> writes:
>> a = re.sub ( '-', '- ', a) # split words with - >> + a = re.sub ( ' - - ', ' -- ', a) # unless was originally " -- " Juergen> Just being curious: Juergen> Maybe I am totally wrong (since I do not know the abc format in Juergen> detail), but shouldn't this be rather something like Juergen> a = re.sub ( '([^-])-([^-])', '\\1- \\2', a) # split words with "-" unless was originally "--" Juergen> or similar (untested)? I just tested it and in actual code, yours seems to do the same thing mine does, except I find it harder to read. What do you think is the advantage of yours over mine? The code I tested on was: The normal way to type multiple syllables in ABC: a = "mul- ti- ple syl- la- bles" Where your version produces: >>> a = re.sub ( '([^-])-([^-])', '\\1- \\2', a) >>> print a mul- ti- ple- syl- la- bles and my version produces: >>> a = "mul- ti- ple syl- la- bles" >>> a = re.sub ( '-', '- ', a) >>> a = re.sub ( ' - - ', ' -- ', a) >>> print a mul- ti- ple syl- la- bles >>> The option I'd like to add is to be able to type the -- to indicate lyric extenders. As far as I know, this is not supported by other ABC applications, but my group voted that it makes the lyrics more readable, so I'd like to implement it. I don't think it's likely that anyone would type the " -- " to mean a single syllable in normal ABC. So that test went: Your version: >>> a = "mul -- ti -- ple syl -- la -- ble" >>> a = re.sub ( '([^-])-([^-])', '\\1- \\2', a) >>> print a mul -- ti -- ple syl -- la -- ble My version: >>> a = "mul -- ti -- ple syl -- la -- ble" >>> a = re.sub ( '-', '- ', a) >>> a = re.sub ( ' - - ', ' -- ', a) >>> print a mul -- ti -- ple syl -- la -- ble >>> -- Laura (mailto:[EMAIL PROTECTED] , http://www.laymusic.org/ ) (617) 661-8097 fax: (501) 641-5011 233 Broadway, Cambridge, MA 02139 _______________________________________________ lilypond-devel mailing list lilypond-devel@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-devel