in reply to Pig Latin
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; }
|
---|
Replies are listed 'Best First'. | |
---|---|
RE: (2) Pig Latin (another smidge closer)
by ybiC (Prior) on Jul 23, 2000 at 17:35 UTC |