lolcommits 0.5.1 → 0.5.2.pre1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,101 +0,0 @@
1
- # Adapted and expanded from moar-lolspeak (https://github.com/rwtnorton/moar-lolspeak), which was
2
- # largely taken from an old Perl script and is sadly is not available via rubygems
3
-
4
- module Lolspeak
5
- LOL_DICTIONARY = {
6
- /what/ => %w{wut whut},
7
- /you\b/ => %w{yu yous yoo u yooz},
8
- /cture/ => %w{kshur},
9
- /ss\b/ => %w{s zz z},
10
- /the\b/ => %w{teh},
11
- /more/ => %w{moar},
12
- /my/ => %w{mah mai},
13
- /are/ => %w{is ar},
14
- /eese/ => %w{eez},
15
- /ph/ => %w{f},
16
- /as\b/ => %w{az},
17
- /seriously/ => %w{srsly},
18
- /sion/ => %w{shun},
19
- /just/ => %w{jus},
20
- /ose\b/ => %w{oze},
21
- /eady/ => %w{eddy},
22
- /ome?\b/ => %w{um},
23
- /of\b/ => %w{of ov of},
24
- /uestion/ => %w{wesjun},
25
- /want/ => %w{wants},
26
- /ead\b/ => %w{edd},
27
- /ck/ => %w{kk kkk},
28
- /sion/ => %w{shun},
29
- /cat|kitten|kitty/ => %w{kitteh kittehz cat fuzzeh fuzzyrumpus foozles fuzzbut fluffernutter beast mew},
30
- /eak/ => %w{ekk},
31
- /age/ => %w{uj},
32
- /like/ => %w{likez liek licks},
33
- /love/ => %w{lovez lub lubs luv lurve lurves},
34
- /\bis\b/ => ['ar teh','ar'],
35
- /nd\b/ => %w{n n'},
36
- /who/ => %w{hoo},
37
- /'/ => [''],
38
- /ese\b/ => %w{eez},
39
- /outh/ => %w{owf},
40
- /scio/ => %w{shu},
41
- /esque/ => %w{esk},
42
- /ture/ => %w{chur},
43
- /\btoo?\b/ => %w{to t 2 to t},
44
- /tious/ => %w{shus},
45
- /sure\b/ => %w{shur},
46
- /tty\b/ => %w{tteh},
47
- /were/ => %w{was},
48
- /ok\b|okay/ => %w{kthxbye!},
49
- /\ba\b/ => %w{uh},
50
- /ym/ => %w{im},
51
- /fish/ => %w{ghoti},
52
- /thy\b/ => %w{fee},
53
- /\wly\w/ => %w{li},
54
- /que\w/ => %w{kwe},
55
- /\both/ => %w{udd},
56
- /though\b/ => %w{tho},
57
- /(t|r|en)ough/ => %w{\1uff},
58
- /ought/ => %w{awt},
59
- /ease/ => %w{eez},
60
- /ing\b/ => %w{in ins ng ing in'},
61
- /have/ => ['haz', 'hav', 'haz a'],
62
- /has/ => %w{haz gots},
63
- /your/ => %w{yur ur yore yoar},
64
- /ove\b/ => %w{oov ove uuv uv oove},
65
- /for/ => %w{for 4 fr fur for foar},
66
- /thank/ => %w{fank tank thx thnx},
67
- /good/ => %w{gud goed guud gude gewd goot gut},
68
- /really/ => %w{rly rily rilly rilleh},
69
- /world/ => %w{wurrld whirld wurld wrld},
70
- /i'?m\b/ => ['im', 'i yam', 'i iz'],
71
- /(?!e)ight/ => %w{ite},
72
- /(?!ues)tion/ => %w{shun},
73
- /you'?re/ => %w{yore yr},
74
- /can\si\s(?:ple(?:a|e)(?:s|z)e?)?\s?have\sa/ => ['i can haz'],
75
- /(?:hello|\bhi\b|\bhey\b|howdy|\byo\b),?/ => ['oh hai,'],
76
- /(?:god\b|allah|buddah?|diety|lord)/ => ['ceiling cat'],
77
- /er\b|are|ere/ => %w{r},
78
- /y\b|ey\b/ => %w{eh},
79
- /ea/ => %w{ee},
80
- }
81
-
82
- def self.tranzlate(str)
83
- lolstr = str.dup
84
- LOL_DICTIONARY.each do |english, lolspeak|
85
- lolstr.gsub!(english, lolspeak.shuffle.first) #ghetto ruby1.8/1.9 agnostic version of choice vs sample
86
- end
87
-
88
- lolstr << '! kthxbye!' if rand(10) == 2
89
- lolstr.gsub!(/(\?|!|,|\.)+/, '!')
90
-
91
- lolstr.upcase
92
- end
93
- end
94
-
95
- class String
96
- unless method_defined?(:tranzlate)
97
- def tranzlate
98
- Lolspeak.tranzlate(self)
99
- end
100
- end
101
- end