[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Another patch (this one is important) to abc2ly
From: |
Laura Conrad |
Subject: |
Re: Another patch (this one is important) to abc2ly |
Date: |
Mon, 02 Oct 2006 09:03:30 -0400 |
User-agent: |
Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux) |
>>>>> "Juergen" == Juergen Reuter <address@hidden> 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:address@hidden , http://www.laymusic.org/ )
(617) 661-8097 fax: (501) 641-5011
233 Broadway, Cambridge, MA 02139