| Lingua-Bork documentation | Contained in the Lingua-Bork distribution. |
Lingua::Bork - Perl extension for Bork Bork Bork
use Lingua::Bork 'bork';
print bork("This is the conjunction junction.")
Bork Bork Bork.
None by default.
Can export bork function for convenience.
Michael Ching, <michaelc@wush.net>
http://www.cs.yorku.ca/course_archive/2000-01/W/3311/assignments/a1.pdf
Automagically title cases words to distinguish start and end 'e'.
This man page is not in Bork Bork Bork.
| Lingua-Bork documentation | Contained in the Lingua-Bork distribution. |
package Lingua::Bork; use strict; use warnings; require Exporter; use vars qw(@ISA %EXPORT_TAGS @EXPORT_OK $VERSION); @ISA = qw(Exporter); %EXPORT_TAGS = ( 'all' => [ 'bork' ] ); @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); $VERSION = '0.03'; my %map = ( tion => 'shun', # tail only the => 'zee', # full match an => 'un', au => 'oo', en => 'ee', # tail only ir => 'ur', ow => 'oo', # E => 'I', # head only e => 'ea', # tail only f => 'ff', # i => 'ee', # first in word o => 'u', # within word u => 'oo', v => 'f', w => 'v', ); sub new { my $class = shift; bless {}, ref($class)||$class; } sub bork { local $_ = shift; local $_ = shift if ref($_); s/(tion\b|\bthe\b|an|au|en\b|ir|ow|e\b|f|\Bo\B|u|v|w)/my $trans = $map{lc $1}; $1 eq lc($1) ? $map{lc $1} : ucfirst($map{lc $1})/eig; # first i in a word s/(i)(\S+)/ $1 eq 'i' ? "ee$2" : "Ee$2" /eig; # leading e s/\b(e)(?!e)/ $1 eq 'e' ? 'i' : 'I' /eig; s/([.!?])+/$1 Bork Bork Bork!/g; return $_; } 1; __END__