Acme-AliG
view release on metacpan or search on metacpan
lib/Acme/AliG.pm view on Meta::CPAN
"a pay rise" => "mo mula",
"are you going out" => "is you goin out to check some bitches",
"to the pub" => "down the boozer",
"looking at" => "checkin out",
"i feel like" => "i fink i will be",
"he feels like" => "he finks he will be",
"she feels like" => "she finks she will be",
"that's not right" => "dat ain't right",
"slag off" => "dis",
"slags off" => "disses",
"slagged off" => "dissed",
"have a piss" => "do a piss",
"has a piss" => "does a piss",
"had a piss" => "did a piss",
"having a piss" => "doing a piss",
"slagging off" => "dissing",
"welcome to" => "hear me now, dis is",
);
sub alig {
my ($s) = @_;
while (my ($key, $value) = each %phrases) { $s =~ s/\b$key\b/$value/g }
while (my ($key, $value) = each %words) { $s =~ s/\b$key\b/$value/g }
foreach (split ' ', $s) {
$s =~ s/ing\b/in/g;
$s =~ s/th\b/f/g;
$s =~ s/en\b/un/g;
$s =~ s/er\b/a/g;
$s =~ s/or\b/a/g;
#$s =~ s/^h//;
}
if ($s =~ /\?/) {
$s =~ s/(.*\?)/$1 Is it becoz I is black?/ if int(rand() * 3) == 0;
} elsif ($s =~ /!/) {
$s =~ s/(.*)!/$1, boyakasha!/ if int(rand() * 3) == 0;
}
return $s;
}
# ABSTRACT: Translates from English to Ali G
1;
__END__
=pod
=head1 NAME
Acme::AliG - Translates from English to Ali G
=head1 VERSION
version 0.0102
=head1 SYNOPSIS
echo hello | alig
The above command will print 'allo'.
=head1 DESCRIPTION
This module provides a script called alig. It will translate whatever you
feed it via STDIN from English to Ali G.
=head1 AUTHOR
Naveed Massjouni <naveedm9@gmail.com>
=head1 COPYRIGHT AND LICENSE
This software is copyright (c) 2011 by Naveed Massjouni.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
=cut
( run in 2.261 seconds using v1.01-cache-2.11-cpan-5a3173703d6 )