aboutsummaryrefslogtreecommitdiff
path: root/challenge-274/joelle-maslak/raku/ch-1.raku
blob: f2cf1c606cf4d81b4f483605ad4408929fb8b1a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/usr/bin/env raku
use v6.d;

my $sentence = @*ARGS.join(" ");
$sentence ~~ s:i:g/<!after \S> ( <[aeiou]>   \S*)/{$0}ma/;
$sentence ~~ s:i:g/<!after \S> (<-[aeiou]>) (\S*)/{$1}{$0}ma/;

my (@words) = $sentence.words;
my $append = "a";
for @words {
    $_ ~= $append;
    $append ~= "a";
}
$sentence = @words.join(" ");
say $sentence;