[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [SpeechIO-28] /'s in Speechd.sub



You're right.  Its no better, I'll leave it out...


k

------------------------------------------------------------------------------
"Perl combines all of the worst aspects of BASIC, C and line noise." 
    -- Keith Packard <keithp@ncd.com>
mortis@voicenet.com                            http://www.voicenet.com/~mortis
------------------------------------------------------------------------------

On Mon, 9 Aug 1999, Darxus wrote:

> On Mon, 9 Aug 1999, Kyle Burton wrote:
> 
> > This should work as an alternative:
> > 
> > $text =~ s/\b(.+?\b)/$wordsub{$1} || $1/eg;
> > 
> > 
> > it basicly says:  word boundry (anything, non-greedy) word boundry
> > 
> > I'm going to incorporate it into my changes...unless you say otherwise.
> 
> Go for it.  But is it actually going to do what you want ?  It looks like
> \b matches anything that doesn't match \w [a-z][A-Z][1-9], so it looks
> like it would still ignore things like slashes ?
> 
> The problem is going to be determining exactly what characters we want
> included in substitution, and which we don't.  You're not going to want to
> include any of the following "',.()[] 
> because they will all be found right up against words (w/out any
> whitespace or anything else to delimit them), and so a word up against one
> of those characters wouldn't get replaced as it should.  
> 
> But if we were to do a bruteforce foreach $key in %wordsub... we wouldn't
> have that problem.
> 
> I predict a new flag :) 
> __________________________________________________________________
> PGP fingerprint = 03 5B 9B A0 16 33 91 2F  A5 77 BC EE 43 71 98 D4
>             darxus@op.net / http://www.op.net/~darxus
>                          Far Beyond Reason
> 
>