Jim Magnuson wrote:
> Hi,
Hello,
> For purposes of doing some processing on a Finnish corpus, I want to
> convert repeated vowel strings to a single occurrence of the uppercase
> form of the vowel. That is:
>
> "aa" -> "A"
> "ii" -> "I"
> "oo" -> "O"
>
> Is it possible to do this without specifying separate substitutions for
> each vowel?
You could do it something like this:
my %convert = (
aa => 'A',
ii => 'I',
oo => 'O',
);
$corpus =~ s/(aa|ii|oo)/$convert{$1}/g;
John
--
Perl isn't a toolbox, but a small machine shop where you can special-order
certain sorts of tools at low cost and in short order. -- Larry Wall
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/