1 # turns english text into piglatin
2 # Copyright (c) 2005 Tim Riker <Tim@Rikers.org>
15 # FIXME: does not handle:
16 # punctuation and hyphens
17 # y as vowel "style" -> "ylestay"
19 for my $word (split /\s+/, $text) {
21 if ($word =~ /^(qu)(.*)/ ) {
22 $pigword = "$2$1$suffix";
23 } elsif ($word =~ /^(Qu)(.)(.*)/ ) {
24 $pigword = uc($2) . $3 . lc($1) . $suffix;
25 } elsif ($word =~ /^([bcdfghjklmnpqrstvwxyz]+)(.*)/ ) {
26 $pigword = "$2$1$suffix";
27 } elsif ($word =~ /^([BCDFGHJKLMNPQRSTVWXYZ])([bcdfghjklmnpqrstvwxyz]*)([aeiouy])(.*)/ ) {
28 $pigword = uc($3) . $4 . lc($1) . $2 . $suffix;
30 $pigword = $word . 'w' . $suffix;
32 $piglatin .= " $pigword";
34 &::performStrictReply($piglatin||'failed');