lolcat: New filter.
authorJoey Hess <joey@kitenet.net>
Mon, 1 Apr 2013 17:46:04 +0000 (13:46 -0400)
committerJoey Hess <joey@kitenet.net>
Mon, 1 Apr 2013 17:46:04 +0000 (13:46 -0400)
debian/changelog
filters.6
lolcat [new file with mode: 0755]

index a432820ca4deb5d5f3b5b9d8bde3426434a0ff3a..df19b14f41892d99da031e7716ac1972601e9277 100644 (file)
@@ -1,6 +1,7 @@
 filters (2.49) UNRELEASED; urgency=low
 
   * scottish: Fix typo. Closes: #688905
+  * lolcat: New filter.
 
  -- Joey Hess <joeyh@debian.org>  Wed, 26 Sep 2012 15:46:28 -0400
 
index fd860e5bf756b9c886ebcaa5d960db9b6ca04bc9..29f9bd984b923d1e84dccdafa4a9817ac4036bc8 100644 (file)
--- a/filters.6
+++ b/filters.6
@@ -19,6 +19,8 @@ text to stdout. Some filters also support reading from files and
 writing to stdout.
 .IP b1ff
 The B1FF filter
+.IP lolcat
+As seen in internet gifs everywhere.
 .IP cockney
 Cockney English
 .IP chef
diff --git a/lolcat b/lolcat
new file mode 100755 (executable)
index 0000000..22c4a58
--- /dev/null
+++ b/lolcat
@@ -0,0 +1,86 @@
+#!/usr/bin/perl -p
+# lolcatz filtur
+# Copyright 2013 by Joey Hess under the terms of the GNU GPL.
+
+# an array, not a hash. because order is important
+@trans_table=(
+       'can i' => 'i can',
+       '\bi\'ve' => 'i',
+       '\ba\s+' => '', # nuke 'a'
+       'cheese' => 'cheez',
+       '\brock\b' => 'rawk',
+       'ese\b' => 'ees',
+       's\'s\b' => 's',
+       '\'s\b' => 's',
+       'er\b' => 'r',
+       'ture\b' => 'chur',
+       'day' => 'dai',
+       '\bok\b' => 'k',
+       '\boks\b' => 'ks',
+       'boy' => 'boi',
+       'tion' => 'shun',
+       'ight' => 'ite',
+       'innocent' => 'innozent',
+       'ph' => 'f',
+       'es' => 'ez',
+       'ed\b' => 'd',
+       'ns' => 'nz',
+       'ks' => 'kz',
+       'ds' => 'dz',
+       'se' => 'ze',
+       'zs' => 's',
+       'sz' => 'z',
+       'ss' => 's',
+       'cc' => 'cs',
+       'ck' => 'k',
+       'oa' => 'o',
+       '\bcat' => 'kat',
+       'ive\b' => 'iv',
+       'ake' => 'aek',
+       'ed\b' => 'd',
+       'ing\b' => 'in', 
+       'sion' => 'shun',
+       '\bam\b' => 'iz',
+       '\bhave\b' => 'has',
+       '\bwho' => 'hoo',
+       '\bwake\b' => 'waek',
+       '\bone\b' => '1',
+       '\btwo\b' => '2',
+       '\bto\b' => '2',
+       '\btoo\b' => '2',
+       '\bthree\b' => '3',
+       '\bfour\b' => '4',
+       '\bfor\b' => '4',
+       '\bfore\b' => '4',
+       '\bfive\b' => '5',
+       '\bsix\b' => '6',
+       '\bseven\b' => '7',
+       '\beight\b' => '8',
+       '\bnine\b' => '9',
+       '\bten\b' => '10',
+       'god' => 'ceilin cat',
+       'jezus' => 'jebus',
+       'kitty' => 'kitteh',
+       'saturdai' => 'katurdai',
+       'allah' => 'invisible man',
+       'delicious' => 'delishus',
+       '\bdoctor\b' => 'docta',
+       '\bdr\b' => 'docta',
+       '\bgay\b' => 'ghey',
+       '\bgood\b' => 'gud',
+       '\bever' => 'evr',
+       '\bpage\b' => 'paeg',
+       'cheezburgr' => 'cheezburger', # fix up to canonical form
+);
+
+y/A-Z/a-z/;
+
+while (@trans_table) {
+       $key=shift @trans_table;
+       $value=shift @trans_table;
+       s/$key/$value/g;
+}
+
+s/es/ez/g;
+
+y/a-z/A-Z/;
This page took 0.014339 seconds and 4 git commands to generate.