It depends on how general you want to be. My first run attempt is:
while(<>) { s{ \b([bcdfghjklmpqrstvwxyz]?)(\w+) } { if($1) {$2.$1.'ay'} else {$2."way"} }egix; print; }
The problem is that this doesn't correctly treat cases like th, sh, pr, etc. where there's really a compound starting consonant. Maybe, this would be a bit more correct:
while(<>) { s{ \b([bcdfghjklmpqrstvwxyz]*)([aeiou]+)(\w*) } { if($1) {$2.$3.$1.'ay'} else {$2.$3."way"} }egix; print; }
In reply to Re: Pig Latin
by Anonymous Monk
in thread Pig Latin
by vroom
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |