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