in reply to phrase marking
Please see Writeup Formatting Tips (You should not have <code> tags around your whole node.)
With many phrases, I'd probably do something like this:
my @phrases = ( 'pail of water', 'pale horse' ); my $phrases_re = join '|', map { quotemeta } @phrases; foreach my $sentence ( @sentence_source ) { $sentence =~ s/($phrases_re)/\#$1\#/g; }
Thanks to JadeNB for pointing out that I'd swapped "pale" and "pail".
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: phrase marking
by newbio (Beadle) on Sep 09, 2008 at 17:25 UTC | |
by kyle (Abbot) on Sep 09, 2008 at 18:49 UTC | |
by newbio (Beadle) on Sep 10, 2008 at 18:51 UTC | |
by kyle (Abbot) on Sep 10, 2008 at 19:31 UTC |