Loading ...
Sorry, an error occurred while loading the content.
 

Re: [Clip] Extracting text from a music .XML file.

Expand Messages
  • Alec Burgess
    ... Hi Flo/Axel re: people vs peo ple - my assumption was that this marked changes when singing so leaving a space between them might well be correct.
    Message 1 of 47 , Nov 12, 2012
      On 2012-11-12 11:13, flo.gehrke wrote:
      > --- In ntb-clips@yahoogroups.com <mailto:ntb-clips%40yahoogroups.com>,
      > Don <don@...> wrote:
      > >
      > > I don't see the "logic" in the data exactly...
      >
      > So do I :-(
      >
      > I understand that it's about extracting the strings between '<text>'
      > and ''</text>' only and re-arranging them according with the 'lyric
      > number'. Is this correct?
      >
      > So I've tested a short clip that outputs...
      >
      > People
      > Hailthe
      > Buildthe
      >
      > when run against your XML sample code.
      Hi Flo/Axel
      re: "people" vs "peo<space>ple - my assumption was that this marked
      changes when singing so leaving a space between them might well be correct.
      - I was hacking at this last night trying to come up with non-looping
      (regex) solutions just because they are more fun.

      (1) I came up with a one-line regex that strips changes the input to:
      001 word-1a
      002 word-2a
      001 word-1b
      001 word-1c
      ...
      0027 word-27-a
      etc.

      (2) Next regex changes 0027 to 027

      (3) then another to strip out any blank lines or other separating text
      not inside a <lyric>...</lyric> block.

      (4) then one liner to $strsort()$ ascending which pulls them all together.

      (5) then a one-liner that will convert
      001 word-1a
      001 word-1b
      001 word-1c
      002 word2-a
      002 word2-b

      to
      001 word-1a word-1b
      001 word1c
      002 word2a word2b

      ie. ^!replace "(\d+)(\x20.*\R)\1" >> "$1 $2" rwsai

      what I couldn't figure out was how to do *ALL* the 001's in one regex.
      At that point I gave up but "waving hands" assume it can be done in a
      loop that will execute the above regex on whole input until it
      on-errors. It would execute once each for the maximum number of words on
      any given line but not be dependent on the number of lines itself.

      so ignoring extra lines for ^!set variables to make it more readable its
      essentially a 5 line (plus 3 lines for :loop/onerror exit/goto loop
      wrapping regex (5) above).

      Question: was your approach similar?


      [Non-text portions of this message have been removed]
    • Adrian Worsfold
      Hello flo Brilliant. Later on today I will alter the clip and instructions on my webpage. How you have managed to account for different line lengths in verses
      Message 47 of 47 , Nov 16, 2012
        Hello flo

        Brilliant. Later on today I will alter the clip and instructions on my webpage. How you have managed to account for different line lengths in verses baffles me but thanks and I'll give appropriate thanks on the webpage when I re do it, including your further advice.




        Adrian Worsfold

        http://www.pluralist.co.uk
        http://pluralistspeaks.blogspot.com
        pluralist@...
        16-11-2012
        ----- Received the following content -----
        From: flo.gehrke
        Receiver: ntb-clips
        Time: 2012-11-16, 13:42:25
        Subject: Re: [Clip] Extracting text from a music .XML file.


        [Non-text portions of this message have been removed]
      Your message has been successfully submitted and would be delivered to recipients shortly.