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

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

Expand Messages
  • Don
    My version: ^!Jump Doc_Start ^!Set %LyricCounter%= 1 ... ^!Set %LyricEnd%= ^%LyricCounter% ;long line follows ^!Set
    Message 1 of 47 , Nov 12, 2012
    • 0 Attachment
      My version:
      ^!Jump Doc_Start

      ^!Set %LyricCounter%="1"

      :GatherLoop
      ^!Set %LyricEnd%="^%LyricCounter%"

      ;long line follows
      ^!Set %Lyrics^%LyricCounter%%="^$GetDocMatchAll(" +\<lyric
      number\="^%LyricCounter%"\>\r\n +\<syllabic\>(.*?)\</syllabic\>\r\n +
      \<text\>(.*?)\</text\>\r\n +\</lyric\>\r\n";2)$"
      ;long line precedes
      ^!If "^%Lyrics^%LyricCounter%%" = "" Process
      ^!Inc %LyricCounter%
      ^!Goto GatherLoop

      :Process
      ^!Set %LyricCounter%="1"
      ^!Select All

      :ProcessLoop
      ^!If "^%LyricCounter%" = "^%LyricEnd%" FinishIt
      ^!InsertText Lyrics ^%LyricCounter%: ^%Lyrics^%LyricCounter%%^P
      ^!Inc %LyricCounter%
      ^!Goto ProcessLoop

      :FinishIt
      ^!Replace ";" >> " " ACIWS


      On 11/12/2012 11:13 AM, flo.gehrke wrote:
      > --- In ntb-clips@yahoogroups.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.
      >
      > The problem is that there are whole words between '<text>' and '</text>' but also syllables only. So 'Peo' and 'ple' produces 'People'. But 'Hail' and 'the' certainly are not meant to produce 'Hailthe', isn't it?
      >
      > A correct combining of these strings needs a space following whole words between '<text>' and '</text>' which is missing in the sample code.
      >
      > With more details of this task we could certainly make further steps towards a solution.
      >
      > Regards,
      > Flo
      >
      >
      >
      > ------------------------------------
      >
      > Fookes Software: http://www.fookes.com/
      > NoteTab website: http://www.notetab.com/
      > NoteTab Discussion Lists: http://www.notetab.com/groups.php
      >
      > ***
      > Yahoo! Groups Links
      >
      >
      >
      >
    • 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
      • 0 Attachment
        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.