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;