* Deal with the new flex 2.5.31 as follows:
[filters.git] / jive.l
CommitLineData
dc17484a 1%{
2/*
3 * Lex filter to transform plain English into Jive English.
4 * No racial or societal slurs are intended. For amusement only.
5 *
6 * Copyright 1986 by Daniel Klein and Clement Cole.
7 *
8 * Reproduction permitted so long as this notice is retained.
9 */
7f4e9d5e 10
dc17484a 11%}
12%e 1700
13%p 4000
14%n 700
15%k 450
16%a 1700
17%o 1500
18BW [ \t\(]
19EW [ \t.,;!\?$\)]
20%%
21@[Bb]egin(.*) |
22".so ".*$ printf("%s", yytext);
23{BW}send printf("%ct'row",yytext[0]);
24program+ printf("honky code");
25[Uu]nix printf("slow mo-fo");
26UNIX printf("dat slow mo-fo");
27actual printf("ak'shul");
28{BW}take printf("%csnatch",yytext[0]);
29{BW}took |
30{BW}take[ns] printf("%csnatch'd",yytext[0]);
31[Mm]exican printf("%cet-back", caseify('w'));
32[Ii]talian printf("%creaser", caseify('g'));
33{BW}big{EW} { printf("%cbig ass",yytext[0]);plastc();}
34fool printf("honkyfool");
35modem printf("doodad");
36{BW}he{EW} { printf("%cmah' man he",yytext[0]);plastc();}
37"e the"{EW} |
38"a the"{EW} |
39"t the"{EW} |
40"d the"{EW} { printf("%c da damn", yytext[0]);plastc();}
41wife |
42woman printf("mama");
43girl printf("goat");
44something printf("sump'n");
45{BW}lie printf("%chonky jive",yytext[0]);
46-o- printf("-on rebound-");
47[a-z]"." { printf("%s", yytext);expletive();}
48! printf(". Right On!");
49[Ss]ure printf("%cho'", yytext[0]);
50get printf("git");
51"will have"{EW} |
52"will"{EW} |
53"got to"{EW} { printf("gots'ta");plastc();}
54"I am" printf("I's gots'ta be");
55"aren't" |
56"am not" |
57"have not" |
58"is not" |
59"are not" printf("ain't");
60{BW}see{EW} { printf("%csee's",yytext[0]);plastc();}
61{BW}are{EW} { printf("%cis",yytext[0]);plastc();}
62{BW}hat{EW} { printf("%cfedora",yytext[0]);plastc();}
63{BW}shoe printf("%ckicker",yytext[0]);
64{BW}"have to"{EW} |
65{BW}has{EW} { printf("%cgots'ta",yytext[0]);plastc();}
66have printf("gots'");
67{BW}go{EW} |
68{BW}"come over"{EW} |
69{BW}come{EW} { printf("%cmosey on down",yytext[0]);plastc();}
70buy printf("steal");
71{BW}car{EW} { printf("%cwheels",yytext[0]);plastc();}
72drive printf("roll");
73{BW}food printf("%ccatfish an' colluhd greens",yytext[0]);
74{BW}eat{EW} { printf("%cfeed da bud",yytext[0]);plastc();}
75drink printf("guzzle");
76black |
77negro printf("brother");
78white printf("honky");
79nigger printf("gentleman");
80nice printf("supa' fine");
81{BW}person printf("%csucka'",yytext[0]);
82[Pp]eople printf("%cucka's", caseify('s'));
83{BW}thing thing(yytext[0]);
84house{EW} { printf("crib");plastc();}
85home printf("plantation");
86name printf("dojigger");
87{BW}path printf("%calley",yytext[0]);
88[Cc]omputer printf("%clunker", yytext[0]);
89or printf("o'");
90president printf("super-dude");
91"prime minister" printf("prahm mistah");
92government printf("guv'ment");
93knew printf("knowed");
94[Bb]ecause printf("'%cuz", caseify('c'));
95[Yy]our printf("%co'", yytext[0]);
96[Ff]our printf("%coe", yytext[0]);
97got printf("gots");
98young printf("yung");
99you printf("ya'");
100You printf("You's");
101first printf("fust");
102police printf("honky pigs");
103{BW}string printf("%cchittlin'",yytext[0]);
104{BW}read printf("%ceyeball",yytext[0]);
105write printf("scribble");
106think{EW} { printf("thin'");plastc();}
107with printf("wif");
108other printf("uthu'");
109[Tt]hr printf("%c'r", yytext[0]);
110[Tt]h printf("%c", caseify('d'));
111ing printf("in'");
112{BW}a{EW} { printf("%csome",yytext[0]);plastc();}
113{BW}to{EW} { printf("%ct'",yytext[0]);
114 if(yytext[yyleng-1]!=' ')
115 plastc();
116 }
117tion printf("shun");
118[Aa]lmost printf("%cos'", caseify('m'));
119from printf("fum");
120[Yy]"ou're" printf("%couse", yytext[0]);
121alright |
122okay printf("coo'");
123[Aa]nd printf("%cn'", yytext[0]);
124known printf("knode");
125want printf("wants'");
126beat printf("whup'ed");
127ile printf("ah'l");
128er{EW} { printf("uh");plastc();}
129[a-z]sti printf("%cs'i", yytext[0]);
130tute printf("toot");
131exp printf("'sp");
132exs |
133exc printf("'s");
134{BW}ex printf("%c'es",yytext[0]);
135[ae]ct{EW} { printf("%cc'", yytext[0]); plastc(); }
136like printf("likes");
137done |
138did printf("dun did");
139"kind of" printf("kind'a");
140women printf("honky chicks");
141{BW}man{EW} { printf("%cdude",yytext[0]);plastc();}
142{BW}men{EW} |
143{BW}mens{EW} { printf("%cdudes",yytext[0]);plastc();}
144injured printf("hosed");
145killed |
146dead printf("wasted");
147good printf("baaaad");
148open{EW} { printf("jimmey");plastc();}
149opened{EW} { printf("jimmey'd");plastc();}
150{BW}very printf("%creal",yytext[0]);
151per printf("puh'");
152oar printf("o'");
153{BW}can printf("%ckin",yytext[0]);
154{BW}just{EW} { printf("%cplum",yytext[0]);plastc();}
155[Dd]etroit printf("Mo-town");
156[Ww]"estern "[Ee]"lectric" printf("da' cave");
157{BW}believe printf("%crecon'",yytext[0]);
158[Ii]"ndianapolis" printf("Nap-town");
159Daniel |
160Dan printf("Liva' Lips");
161Reagan printf("Kingfish");
162Ronald{EW} |
163Ron{EW} { printf("Rolo");plastc();}
164John printf("Rastus");
165Jim printf("Bo-Jangles");
166pontiff |
167pope printf("wiz'");
168[Pp]ravda printf("dat commie rag");
169broken printf("bugger'd");
170strange{EW} { printf("funky");plastc();}
171dance{EW} { printf("boogy");plastc();}
172ask printf("ax'");
173{BW}so{EW} { printf("%cso's",yytext[0]);plastc();}
174heard printf("'hoid");
175head printf("'haid");
176boss printf("main man");
177money printf("bre'd");
178[a-z]":" { *(yytext+1) = ',';
179 printf("%s dig dis:",yytext);
180 }
181amateur printf("begina'");
182radio printf("transista'");
183{BW}of{EW} { printf("%cuh",yytext[0]);plastc();}
184which |
185what printf("whut");
186"don't" printf("doan'");
187does printf("duz");
188{BW}was{EW} |
189{BW}were{EW} { printf("%cwuz",yytext[0]);plastc();}
190{BW}understand printf("%cdig",yytext[0]);
191{BW}my printf("%cmah'",yytext[0]);
192again |
193against printf("agin'");
194{BW}[Ii]{EW} { printf("%cah'",yytext[0]);plastc();}
195meta printf("meta-fuckin'");
196cally printf("c'l");
197%%
198plastc()
199{
7f4e9d5e 200 yyunput(yytext[yyleng-1], yytext);
dc17484a 201}
202
203caseify(c)
204char c;
205{
206 if (yytext[0] <= 'Z')
207 return (c - ' ');
208 else
209 return (c);
210}
211
212thing(c)
213char c;
214{
215 static short count = 0;
216
217 putchar(c);
218 switch (count++ % 4) {
219 case 0: case 2:
220 printf("thang");
221 break;
222 case 1:
223 printf("doohickey");
224 break;
225 case 3:
226 printf("wahtahmellun");
227 break;
228 }
229}
230expletive()
231{
232 static short count = 0;
233 static short which = 0;
234
235 if (count++ % 4 == 0) {
236 switch (which++ % 5) {
237 case 0: printf(" What it is, Mama!"); break;
238 case 1: printf(" Ya' know?"); break;
239 case 2: printf(" Sheeeiit."); break;
240 case 3: printf(" Ya' dig?"); break;
241 case 4: printf(" Git down!"); break;
242 }
243 }
244}
245
7f4e9d5e 246main()
247{
248 yylex();
249}
250
251int yywrap()
252{
253 return 1;
254}
255
dc17484a 256/*
257 * Bugs:
258 *
259 * If a sentence starts with a keyword it doan' get converted, or:
260 * it do, but gets a leading space
261 */
This page took 0.023986 seconds and 4 git commands to generate.