Mercurial > hg > config
comparison python/lolspeak.py @ 0:f3ab51c79813
adding configuration from https://svn.openplans.org/svn/config_jhammel/
author | k0s <k0scist@gmail.com> |
---|---|
date | Thu, 15 Oct 2009 11:41:26 -0400 |
parents | |
children | 89121bfe12ff |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:f3ab51c79813 |
---|---|
1 #!/usr/bin/env python | |
2 | |
3 loldict = { 'am': 'is', | |
4 'and': 'n', | |
5 'are': 'r', | |
6 'ate': 'eated', | |
7 'back': 'bak', | |
8 'business': 'bizness', | |
9 'bye': 'bai', | |
10 'cat': 'kitteh', | |
11 'cheeseburger': 'cheezburger', | |
12 'cute': 'kyooot', | |
13 'food': 'foodz', | |
14 'fucking': 'fuxing', | |
15 'have': 'has', | |
16 'help': 'halp', | |
17 'hi': 'hai', | |
18 'is': 'iz', | |
19 'kitty': 'kitteh', | |
20 'later': 'l8r', | |
21 'making': 'makin', | |
22 'means': 'meens', | |
23 'more': 'moar', | |
24 'news': 'newz', | |
25 'please': 'plz', | |
26 'power': 'powr', | |
27 'saturday': 'caturday', | |
28 'says': 'sez', | |
29 'takes': 'takez', | |
30 'thanks': 'kthx', | |
31 'time': 'tiem', | |
32 'the': 'teh', | |
33 'there': 'thar', | |
34 'this': 'dis', | |
35 'towel': 'towul', | |
36 'uses': 'uzes', | |
37 'young': 'yung', | |
38 'your': 'ur' | |
39 } | |
40 | |
41 def translate(string): | |
42 retval = [] | |
43 for word in string.split(): | |
44 retval.append(loldict.get(word.lower(), word)) | |
45 return ' '.join(retval) | |
46 | |
47 if __name__ == '__main__': | |
48 import sys | |
49 if sys.argv[1:]: | |
50 print translate(' '.join(sys.argv[1:])) | |
51 else: | |
52 print translate(sys.stdin.read()) | |
53 |