]> iEval git - text-homestuck.git/blobdiff - lib/Text/Homestuck.pm
Add documentation
[text-homestuck.git] / lib / Text / Homestuck.pm
index 6d9b4fdcb18e3ef9db74da30c2343b156d1be23c..ef508f7e4a94a793233f2dc4c58cfe52a0d2105f 100644 (file)
@@ -3,75 +3,135 @@ package Text::Homestuck;
 use 5.014000;
 use strict;
 use warnings;
-
-require Exporter;
-
-our @ISA = qw(Exporter);
-
-# Items to export into callers namespace by default. Note: do not export
-# names by default without a very good reason. Use EXPORT_OK instead.
-# Do not simply export all your public functions/methods/constants.
-
-# This allows declaration      use Text::Homestuck ':all';
-# If you do not need this, moving things directly into @EXPORT or @EXPORT_OK
-# will save memory.
-our %EXPORT_TAGS = ( 'all' => [ qw(
-       
-) ] );
-
-our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
-
-our @EXPORT = qw(
-       
-);
-
+use parent qw/Exporter/;
+our @EXPORT = qw/aradia tavros sollux karkat nepeta kanaya terezi vriska equius gamzee eridan feferi/;
 our $VERSION = '0.000_001';
-$VERSION = eval $VERSION;  # see L<perlmodstyle>
 
-
-# Preloaded methods go here.
+sub filter {
+       my ($name, $code) = @_;
+       no strict 'refs';
+       *{$name} = sub (;$){
+               local *__ANON__ = $name;
+               if ($_[0]) {
+                       local $_ = $_[0];
+                       $code->();
+                       $_
+               } else {
+                       $code->();
+                       $_
+               }
+       }
+}
+
+filter aradia => sub {
+       y/A-Z/a-z/;
+       y/,.?//d;
+       s/o/0/g;
+};
+
+filter tavros => sub {
+       y/a-zA-Z.!?/A-Za-z,,,/;
+       s/:\)/}:)/g;
+};
+
+filter sollux => sub {
+       y/A-Z/a-z/;
+       y/s/2/;
+       s/i/ii/g;
+       s/to/two/g;
+       s/\b(fuck|joke|kk|aa)\b/\U$1/g;
+};
+
+filter karkat => sub {
+       y/a-z/A-Z/;
+       s/\bD:/D:B/;
+};
+
+filter nepeta => sub {
+       y/A-Z/a-z/;
+       s/ee/33/;
+       $_ = ":33 < $_";
+};
+
+filter kanaya => sub {
+       y/,.!?'//d;
+       s/\b(\w)/\u$1/g;
+};
+
+filter terezi => sub {
+       y/a-z/A-Z/;
+       y/AIE/413/;
+       s/(!|\?)/$1$1/g;
+       s/:\]|:\)/>:]/g;
+};
+
+filter vriska => sub {
+       y/Bb/88/;
+       s/:\)/::::\)/g;
+       s/D:/D::::/g;
+};
+
+filter equius => sub {
+       s/strong/STRONG/g;
+       s/strength/STRONGNESS/g;
+       s/x/%/ig;
+       s/loo/100/ig;
+       s/ool/001/ig;
+       s/[?.!]$//;
+       $_ = "D --> $_";
+};
+
+filter gamzee => sub {
+       y/[A-Z]/[a-z]/;
+       s/([a-z])(.)/$1\u$2/g;
+       s/:\)/:o\)/g;
+};
+
+filter eridan => sub {
+       y/',.?!//d;
+       s/w/ww/g;
+       s/v/vv/g;
+       s/ing/in/g;
+       s/want to/wanna/g;
+       s/going to/gonna/g;
+};
+
+filter feferi => sub {
+       s/H/)(/g;
+       s/E/-E/g;
+       s/:\)/38)/g;
+};
 
 1;
 __END__
-# Below is stub documentation for your module. You'd better edit it!
 
 =head1 NAME
 
-Text::Homestuck - Perl extension for blah blah blah
+Text::Homestuck - Emulate the typing quirks of Homestuck trolls
 
 =head1 SYNOPSIS
 
   use Text::Homestuck;
-  blah blah blah
+  say feferi 'HELLO WORLD!'; # )(-ELLO WORLD!
+  my @array = ('Move along.', 'Nothing to see here');
+  aradia for @array;
+  say "@array"; # m0ve al0ng n0thing t0 see here
 
 =head1 DESCRIPTION
 
-Stub documentation for Text::Homestuck, created by h2xs. It looks like the
-author of the extension was negligent enough to leave the stub
-unedited.
-
-Blah blah blah.
-
-=head2 EXPORT
-
-None by default.
-
+Text::Homestuck exports several subroutines, one for each typing quirk. There are 12 such functions right now, one for each pre-scratch troll: aradia, tavros, sollux, karkat, nepeta, kanaya, terezi, vriska, equius, gamzee, eridan, feferi.
 
+Each subroutine takes one or no arguments. If called with an argument, they apply the quirk to the argument and return the result. If called with no arguments, they apply the quirk to C<$_>, modifiying it in-place, and returning C<$_>.
 
 =head1 SEE ALSO
 
-Mention other useful documentation such as the documentation of
-related modules or operating system documentation (such as man pages
-in UNIX), or any relevant external documentation such as RFCs or
-standards.
-
-If you have a mailing list set up for your module, mention it here.
+Homestuck: L<http://mspaintadventures.com/?s=6&p=001901>
 
-If you have a web site set up for your module, mention it here.
+A table of typing quirks: L<http://mspaintadventures.wikia.com/wiki/Typing_Quirk>
 
 =head1 AUTHOR
 
-Marius Gavrilescu, E<lt>marius@E<gt>
+Marius Gavrilescu C<< <marius@ieval.ro> >>
 
 =head1 COPYRIGHT AND LICENSE
 
This page took 0.027052 seconds and 4 git commands to generate.