Also close bug
[filters.git] / ken.l
CommitLineData
73fc7494 1%{
2/*
3 * ken:
4 * will turn English into Cockney, featuring (dubious) rhyming slang for a lot
5 * of computer terminology.
6 *
7 * Written by Stephen K Mulrine <smulrine%cs.strath.ac.uk@nsfnet-relay.ac.uk>
8 * Make copies if you want etc.etc.
9 *
10 * Contacted author in June 2001, asked him to clarify the license, he replied
11 * with some improvements and placed the program in the public domain.
12 * -- Edward Betts <edward@debian.org> Mon, 11 Jun 2001 12:04:29 +0100
13 *
14 * ken is named after Ken the Chirpy Cockney Character from the Viz Comic (tm),
15 * who speaks somewhat like that.
16 */
17%}
18%e 3000
19%p 6000
20%n 1000
21%k 500
22%a 4000
23%o 2000
24BW [ ]
25EW [ .,;!?]
26%{
27 char buf[128];
28%}
29
30%%
31
32stairs printf("apples and pears");
33Downstairs printf("Down the apples and pears");
34downstairs printf("down the apples and pears");
35Upstairs printf("Up the apples and pears");
36upstairs printf("up the apples and pears");
37[Mm]outh printf("North and South");
38[Ff]ace printf("Boat Race");
39[Tt]rouble printf("Barney Rubble");
40wife { switch(rand()%2)
41 {
42 case 0: printf("trouble and strife"); break;
43 case 1: printf("ole lady"); break;
44 }
45 }
46Road printf("Frog and Toad");
47" road" printf(" frog and toad");
48"pub " printf("rub-a-dub ");
49" bar " printf(" boozer ");
50" husband" printf(" ole man");
51Party printf("Knees-up");
52party printf("knees-up");
53Parties printf("Knees-ups");
54parties printf("knees-ups");
55My printf("Me");
56" my" printf(" me");
57Your printf("Yer");
58your printf("yer");
59"You are " printf("Yer ");
60"you are " printf("yer ");
61You printf("Yer");
62you printf("yer");
63Those printf("Them");
64those printf("them");
65" those" printf(" them");
66"(those" printf("(them");
67"The " { switch(rand()%5)
68 {
69 case 0: printf("The bleedin' "); break;
70 default: ECHO; break;
71 }
72 }
73"The" ECHO;
74" the " { switch(rand()%5)
75 {
76 case 0: printf(" the bleedin' "); break;
77 default: ECHO; break;
78 }
79 }
80[" "(]the ECHO;
81"the " { switch(rand()%5)
82 {
83 case 0: printf(" the bleedin' "); break;
84 default: ECHO; break;
85 }
86 }
87[Tt]his ECHO;
88[" "(]this ECHO;
89[Tt]hat ECHO;
90[" "(]that ECHO;
91Thus printf("So");
92" thus" printf(" so");
93"(thus" printf("(so");
94"thus" printf("so");
95[Tt]han ECHO;
96[" "(]than ECHO;
97Who ECHO;
98who ECHO;
99" old " printf(" ole ");
100" to " printf(" ter ");
101"Aren't you " printf("Aintcha ");
102"aren't you " printf("aintcha ");
103"Aren't" printf("Ain't");
104"aren't" printf("ain't");
105"Isn't" printf("Ain't");
106"isn't" printf("ain't");
107"Are not " printf("Ain't");
108"are not " printf("ain't ");
109"Is not " printf("Ain't ");
110" is not " printf(" ain't ");
111"What is th" printf("Woss");
112"what is th" printf("woss");
113"What are you " printf("Wotcher ");
114"what are you " printf("wotcher ");
115"What you are" printf("Wotcher");
116"what you are" printf("wotcher");
117"What you're" printf("Wotcher");
118"what you're" printf("wotcher");
119"What are your" printf("Wotcher");
120"what are your" printf("wotcher");
121"What do you " printf("Wotcher ");
122"what do you " printf("wotcher ");
123"What do your" printf("Wotcher");
124"what do your" printf("wotcher");
125" "H[aeu]llo printf(" Wotcher");
126" "h[aeu]llo printf(" wotcher");
127What printf("Wot");
128what printf("wot");
129Were printf("Was");
130were printf("was");
131Bother printf("Ars");
132bother printf("ars");
133Mother printf("Muvver");
134Other printf("Uvver");
135other printf("uvver");
136Father printf("Favver");
137father printf("favver");
138Rather printf("Ravver");
139rather printf("ravver");
140Weather printf("Wevver");
141weather printf("wevver");
142Leather printf("Levver");
143leather printf("levver");
144Wither printf("Wivver");
145wither printf("wivver");
146Either printf("Eever");
147either printf("eever");
148With printf("Wiv");
149with printf("wiv");
150Anything printf("Anyfink");
151anything printf("anyfink");
152Something printf("Sumfink");
153something printf("sumfink");
154Nothing printf("Nuffink");
155nothing printf("nuffink");
156guitars printf("spoons");
157guitar printf("spoons");
158drums printf("spoons");
159drum printf("spoons");
160trumpets printf("spoons");
161trumpet printf("spoons");
162violins printf("spoons");
163violin printf("spoons");
164clarinets printf("spoons");
165clarinet printf("spoons");
166trombones printf("spoons");
167trombone printf("spoons");
168oboes printf("spoons");
169oboe printf("spoons");
170flutes printf("spoons");
171flute printf("spoons");
172tubas printf("spoons");
173tuba printf("spoons");
174Data printf("Info");
175data printf("info");
176Directory printf("Lockup");
177directory printf("lockup");
178Directories printf("Lockups");
179directories printf("lockups");
180[Pp]rocess { switch(rand()%2)
181 {
182 case 0: printf("Queen Bess"); break;
183 case 1: printf("Rudolf 'Ess"); break;
184 }
185 }
186[Cc]omputer printf("French Tutor");
187[Bb]yte printf("Jimmy White");
188[Ff]iles printf("Nobby Stiles");
189[Ff]ile printf("Royal Mile");
190[Ll]anguage printf("'Am Sandwich");
191[Zz]ero printf("Emperor Nero");
192[Jj]ob printf("Uncle Bob");
193[Ss]hell printf("Bow Bell");
194[Ss]ave printf("Chas'n'Dave");
195[Ll]oad printf("Old Kent Road");
196[Mm]ouse printf("Doll's 'Ouse");
197[Bb]uffer printf("Sausage Stuffer");
198[Kk]eyboard printf("Henry Ford");
199[Mm]anual printf("Cocker Spaniel");
200[Ss]creen printf("James Dean");
201[Pp]rinter printf("'Arold Pinter");
202[Pp]lotter printf("Pansy Potter");
203[Cc]ompiler printf("Martin Tyler");
204[Ss]tring printf("Emperor Ming");
205[Bb]rain printf("Michael Caine");
206[Pp][Aa][Ss][Cc][Aa][Ll] { switch(rand()%2)
207 {
208 case 0: printf("Pall Mall"); break;
209 case 1: printf("Roald Dahl"); break;
210 }
211 }
212[Aa][Ll][Gg][Oo][Ll] printf("Johnny Ball");
213[Ff][Oo][Rr][Tt][Rr][Aa][Nn] printf("Manfred Mann");
214[Cc][Oo][Bb][Oo][Ll] printf("Albert Hall");
215[Jj]ava printf("Wot a palavah");
c8d1efb9 216W[aA][pP] printf("Pony and trap");
217" wap" printf(" pony and trap");
73fc7494 218Stopped printf("'Ad the mockers put on");
219stopped printf("'ad the mockers put on");
220Stopping printf("Putting the mockers on");
221stopping printf("putting the mockers on");
222stops printf("puts the mockers on");
223stop printf("put the mockers on");
224STOP printf("Put The Mockers On");
225[Ll]ondoner printf("Cockney");
226friend { switch(rand()%3)
227 {
228 case 0: printf("mucker"); break;
229 case 1: printf("mate"); break;
230 case 2: printf("china"); break;
231 }
232 }
233"a h" printf("an '");
234"A h" printf("An '");
235" h" printf(" '");
236" H" printf(" '");
237" C-" printf(" Bruce Lee-");
238" C " { switch(rand()%4)
239 {
240 case 0: printf(" Bruce Lee "); break;
241 case 1: printf(" Circus Flea "); break;
242 case 2: printf(" Bumble Bee "); break;
243 case 3: printf(" Door Key "); break;
244 }
245 }
246" C." printf(" Circus Flea.");
247Th printf("F");
248Wh printf("W");
249wh printf("w");
250aw printf("or");
251" "[BbKkMmPpRrSsWw]ing ECHO;
252" "[Bb]ring ECHO;
253" "[Ss]ting ECHO;
254" "[Ss]wing ECHO;
255" "[CcFfSs]ling ECHO;
256" Thing" printf(" Fing");
257" thing" printf(" fing");
258
259"ing " printf("in' ");
260". " { switch(rand()%32)
261 {
262 case 0: printf(". I'll get out me spoons. "); break;
263 case 1: printf(". Yer can't 'ave a knees-up wivout a joanna. "); break;
264 case 2: printf(". Cor blimey guv, would I lie to you. "); break;
265 case 3: printf(". I'll make us all a nice cup of tea. "); break;
266 default: ECHO; break;
267 }
268 }
269"? " { switch(rand()%3)
270 {
271 case 0: printf(", mate? "); break;
272 case 1: printf(", guv? "); break;
273 case 2: printf(", squire? "); break;
274 }
275 }
276"! " { switch(rand()%6)
277 {
278 case 0: printf(", cor blimey! "); break;
279 case 1: printf("! Struth! "); break;
280 case 2: printf(", guv! "); break;
281 case 3: printf("! Honest guv! "); break;
282 case 4: printf(", mate! "); break;
283 case 5: ECHO; break;
284 }
285 }
9a251f02 286. printf("%s", yytext);
73fc7494 287\n printf("\n");
288%%
This page took 0.025864 seconds and 4 git commands to generate.