1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 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/;
|