character substitution.

Subject: character substitution.
From: "Pawson, David" <DPawson@xxxxxxxxxxx>
Date: Tue, 11 Aug 1998 14:13:23 +0100

In looking at text->audio preparation using Jade.

I need to 'clean up' some of the text, such that a 
text to speech engine  will speak the element content more clearly.
e.g. <tel>(44) 1733-378-777 </tel>
becomes <tel>44, 1733,378,777 </tel>

I'm looking to examine an element content (CDATA)
and map a function over  the output of the data (current-node).


What I can't get my tiny mind around is the 
sosofo->character->sosofo transformation needed.

I note that Norm, in dbcommon, does a simple (sosofo-append (data
(current-node)) #\.)
which implies I can treat the output of the data function as a char.

Am I looking for a function which does something like

(process-node-list (fnA (fnB  (data (current-node))))

such that fnB does the actual character substitution on the output of the
data function
	           [Input a character sosofo, output a sequence of chars]
              fnA restores the character sequence to a sosofo, given the
character output of fnB
                       [Input a sequenc of chars, output a character sosofo]

then (process-node-list ...) finally produces the output.

Question: Am I vaguely in the right domain?

Do I need to fnA transformation?
Is there a char->sosofo function.

Any help appreciated.

(define subst
  (lambda (stringin)
    (list->string (subst1 (string->list stringin)))))

(define subst1
  (lambda (str)
    (if (null? str) '()
          (if (equal? (car str) #\-) #\,
              (car str))
          (subst1 (cdr str))))))

 DSSSList info and archive:

Current Thread
  • character substitution.
    • Pawson, David - from mail1.ability.netby (8.8.5/8.6.12) with ESMTP id JAA08723Tue, 11 Aug 1998 09:19:56 -0400 (EDT) <=
      • Sebastian Rahtz - from mail1.ability.netby (8.8.5/8.6.12) with ESMTP id JAA09382Tue, 11 Aug 1998 09:33:04 -0400 (EDT)
      • Tom Moertel - from mail1.ability.netby (8.8.5/8.6.12) with ESMTP id LAA15588Tue, 11 Aug 1998 11:38:33 -0400 (EDT)