From 73fc7494e8e3522f3e28d3c45c909e796fd3776c Mon Sep 17 00:00:00 2001 From: joey Date: Mon, 11 Jun 2001 19:13:18 +0000 Subject: [PATCH] * ken is now free. --- Makefile | 2 +- README | 13 ++- debian/changelog | 6 + debian/control | 5 +- debian/copyright | 19 ++- filters.6 | 13 ++- ken.l | 293 +++++++++++++++++++++++++++++++++++++++++++++++ 7 files changed, 336 insertions(+), 15 deletions(-) create mode 100644 ken.l diff --git a/Makefile b/Makefile index 1649d4b..ffd2c8b 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ LEX = flex -ALL = jethro kraut cockney jive nyc +ALL = jethro kraut cockney jive nyc ken OTHER = eleet b1ff chef jibberish upside-down rasterman all: $(OTHER) $(ALL) diff --git a/README b/README index c8358ea..dbbcf92 100644 --- a/README +++ b/README @@ -1,12 +1,13 @@ This is a collection of filters to do all sorts of strange things to text. B1ff, the Swedish Chef, and an eleet filter are included. -Since the original versions of these filters have copyright problems, I have -done a "clean room" re-implementation of the original lex filters in perl. I -did this without looking at the original code to the filters at all, I -simply observed their output and drew my own conclusions, and wrote my own -code. Then I compared the output of the original and new filters when ran on -large bodies of text, and fixed the things I had missed. +Since the original versions of some of these filters have copyright +problems, I have done a "clean room" re-implementation of the original lex +filters in perl. I did this without looking at the original code to the +filters at all, I simply observed their output and drew my own conclusions, +and wrote my own code. Then I compared the output of the original and new +filters when ran on large bodies of text, and fixed the things I had +missed. Here are the results of my investigations of how the filters work: diff --git a/debian/changelog b/debian/changelog index a778bee..3286aa2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +filters (2.16) unstable; urgency=low + + * ken is now free. + + -- Joey Hess Mon, 11 Jun 2001 14:58:58 -0400 + filters (2.15) unstable; urgency=low * Rasterized jubberish, Closes: #81901 diff --git a/debian/control b/debian/control index 6e02ba4..4efb40f 100644 --- a/debian/control +++ b/debian/control @@ -3,11 +3,12 @@ Section: games Priority: optional Build-Depends: debhelper (>= 2.1.0), flex Maintainer: Joey Hess -Standards-Version: 3.2.1.0 +Standards-Version: 3.5.5.0 Package: filters Architecture: any -Conflicts: filters-nonfree (<< 2.4) +Conflicts: filters-nonfree (<< 2.6) +Replaces: filters-nonfree (<< 2.6) Depends: ${shlibs:Depends} Description: a collection of filters, including B1FF and the swedish chef A collection of filters to do all sorts of strange things to text. diff --git a/debian/copyright b/debian/copyright index 4535b17..3b9e24b 100644 --- a/debian/copyright +++ b/debian/copyright @@ -37,4 +37,21 @@ The rasterman filter was pulled out of http://www.xach.com/xachbot/xachbot-2000-07-15.tar.gz, which is as a whole copyright (C) 1997 Zachary Beane and is GPL'd. -Everything else is copyright 1999 by Joey Hess, under the terms of GPL. +The ken filter is now in the public domain. It's author, Stephen K Mulrine, +confirmed the new copyright in this email: + + From: Stephen Mulrine + Date: Mon, 11 Jun 2001 01:06:52 +0100 (BST) + To: edward@debian.org (Edward Betts) + Subject: Re: Ken? + + [...] + + >We would like to include ken in the Debian GNU/Linux Operating System, but + >we need permission to modify ken if we want to. Would you be willing to + >relicense ken under the GNU GPL, a BSD like license, or public domain? + + Certainly, it would be an honour to have it included in the Debian + distribution so I hereby release ken into the public domain. + +Everything else is copyright 1999-2001 by Joey Hess, under the terms of GPL. diff --git a/filters.6 b/filters.6 index 1fb1a8a..f3cf031 100644 --- a/filters.6 +++ b/filters.6 @@ -1,6 +1,6 @@ .TH FILTERS 6 .SH NAME -b1ff, chef, cockney, eleet, jethro, jibberish, jive, kraut, nyc, rasterman, upside-down \- assorted text filters +ken, b1ff, chef, cockney, eleet, jethro, jibberish, jive, kraut, nyc, rasterman, upside-down \- assorted text filters .SH SYNOPSIS $SHELL | chef .SH "DESCRIPTION" @@ -15,14 +15,17 @@ The B1FF filter Cockney English .IP chef convert English on stdin to Mock Swedish on stdout +.IP eleet +K3wl hacker slang .IP jethro Hillbilly text filter .IP jive Jive English .IP jibberish Runs text through all the rest of the filters, to make really weird output. -.IP eleet -K3wl hacker slang +.IP ken +English into Cockney, featuring (dubious) rhyming +slang for a lot of computer terminology. .IP kraut Generates text with a German accent. .IP nyc @@ -39,5 +42,5 @@ The eleet, upside-down, chef, and b1ff filters were written by Joey Hess . Daniel V Klein wrote the cockney, jive, and nyc filters. jibberish is by Raul Miller , jethro is by Duane Paulson -, rasterman is by Zachary Beane, and kraut is -authored by John Sparks. +, rasterman is by Zachary Beane, ken is by +Stephen K Mulrine and kraut is by John Sparks. diff --git a/ken.l b/ken.l new file mode 100644 index 0000000..942564b --- /dev/null +++ b/ken.l @@ -0,0 +1,293 @@ +%{ +/* + * ken: + * will turn English into Cockney, featuring (dubious) rhyming slang for a lot + * of computer terminology. + * + * Written by Stephen K Mulrine + * Make copies if you want etc.etc. + * + * Contacted author in June 2001, asked him to clarify the license, he replied + * with some improvements and placed the program in the public domain. + * -- Edward Betts Mon, 11 Jun 2001 12:04:29 +0100 + * + * ken is named after Ken the Chirpy Cockney Character from the Viz Comic (tm), + * who speaks somewhat like that. + */ +%} +%e 3000 +%p 6000 +%n 1000 +%k 500 +%a 4000 +%o 2000 +BW [ ] +EW [ .,;!?] +%{ + char buf[128]; +%} + +%% + +stairs printf("apples and pears"); +Downstairs printf("Down the apples and pears"); +downstairs printf("down the apples and pears"); +Upstairs printf("Up the apples and pears"); +upstairs printf("up the apples and pears"); +[Mm]outh printf("North and South"); +[Ff]ace printf("Boat Race"); +[Tt]rouble printf("Barney Rubble"); +wife { switch(rand()%2) + { + case 0: printf("trouble and strife"); break; + case 1: printf("ole lady"); break; + } + } +Road printf("Frog and Toad"); +" road" printf(" frog and toad"); +"pub " printf("rub-a-dub "); +" bar " printf(" boozer "); +" husband" printf(" ole man"); +Party printf("Knees-up"); +party printf("knees-up"); +Parties printf("Knees-ups"); +parties printf("knees-ups"); +My printf("Me"); +" my" printf(" me"); +Your printf("Yer"); +your printf("yer"); +"You are " printf("Yer "); +"you are " printf("yer "); +You printf("Yer"); +you printf("yer"); +Those printf("Them"); +those printf("them"); +" those" printf(" them"); +"(those" printf("(them"); +"The " { switch(rand()%5) + { + case 0: printf("The bleedin' "); break; + default: ECHO; break; + } + } +"The" ECHO; +" the " { switch(rand()%5) + { + case 0: printf(" the bleedin' "); break; + default: ECHO; break; + } + } +[" "(]the ECHO; +"the " { switch(rand()%5) + { + case 0: printf(" the bleedin' "); break; + default: ECHO; break; + } + } +[Tt]his ECHO; +[" "(]this ECHO; +[Tt]hat ECHO; +[" "(]that ECHO; +Thus printf("So"); +" thus" printf(" so"); +"(thus" printf("(so"); +"thus" printf("so"); +[Tt]han ECHO; +[" "(]than ECHO; +Who ECHO; +who ECHO; +" old " printf(" ole "); +" to " printf(" ter "); +"Aren't you " printf("Aintcha "); +"aren't you " printf("aintcha "); +"Aren't" printf("Ain't"); +"aren't" printf("ain't"); +"Isn't" printf("Ain't"); +"isn't" printf("ain't"); +"Are not " printf("Ain't"); +"are not " printf("ain't "); +"Is not " printf("Ain't "); +" is not " printf(" ain't "); +"What is th" printf("Woss"); +"what is th" printf("woss"); +"What are you " printf("Wotcher "); +"what are you " printf("wotcher "); +"What you are" printf("Wotcher"); +"what you are" printf("wotcher"); +"What you're" printf("Wotcher"); +"what you're" printf("wotcher"); +"What are your" printf("Wotcher"); +"what are your" printf("wotcher"); +"What do you " printf("Wotcher "); +"what do you " printf("wotcher "); +"What do your" printf("Wotcher"); +"what do your" printf("wotcher"); +" "H[aeu]llo printf(" Wotcher"); +" "h[aeu]llo printf(" wotcher"); +What printf("Wot"); +what printf("wot"); +Were printf("Was"); +were printf("was"); +Bother printf("Ars"); +bother printf("ars"); +Mother printf("Muvver"); +Other printf("Uvver"); +other printf("uvver"); +Father printf("Favver"); +father printf("favver"); +Rather printf("Ravver"); +rather printf("ravver"); +Weather printf("Wevver"); +weather printf("wevver"); +Leather printf("Levver"); +leather printf("levver"); +Wither printf("Wivver"); +wither printf("wivver"); +Either printf("Eever"); +either printf("eever"); +With printf("Wiv"); +with printf("wiv"); +Anything printf("Anyfink"); +anything printf("anyfink"); +Something printf("Sumfink"); +something printf("sumfink"); +Nothing printf("Nuffink"); +nothing printf("nuffink"); +guitars printf("spoons"); +guitar printf("spoons"); +drums printf("spoons"); +drum printf("spoons"); +trumpets printf("spoons"); +trumpet printf("spoons"); +violins printf("spoons"); +violin printf("spoons"); +clarinets printf("spoons"); +clarinet printf("spoons"); +trombones printf("spoons"); +trombone printf("spoons"); +oboes printf("spoons"); +oboe printf("spoons"); +flutes printf("spoons"); +flute printf("spoons"); +tubas printf("spoons"); +tuba printf("spoons"); +Data printf("Info"); +data printf("info"); +Directory printf("Lockup"); +directory printf("lockup"); +Directories printf("Lockups"); +directories printf("lockups"); +[Pp]rocess { switch(rand()%2) + { + case 0: printf("Queen Bess"); break; + case 1: printf("Rudolf 'Ess"); break; + } + } +[Cc]omputer printf("French Tutor"); +[Bb]yte printf("Jimmy White"); +[Ff]iles printf("Nobby Stiles"); +[Ff]ile printf("Royal Mile"); +[Ll]anguage printf("'Am Sandwich"); +[Zz]ero printf("Emperor Nero"); +[Jj]ob printf("Uncle Bob"); +[Ss]hell printf("Bow Bell"); +[Ss]ave printf("Chas'n'Dave"); +[Ll]oad printf("Old Kent Road"); +[Mm]ouse printf("Doll's 'Ouse"); +[Bb]uffer printf("Sausage Stuffer"); +[Kk]eyboard printf("Henry Ford"); +[Mm]anual printf("Cocker Spaniel"); +[Ss]creen printf("James Dean"); +[Pp]rinter printf("'Arold Pinter"); +[Pp]lotter printf("Pansy Potter"); +[Cc]ompiler printf("Martin Tyler"); +[Ss]tring printf("Emperor Ming"); +[Bb]rain printf("Michael Caine"); +[Pp][Aa][Ss][Cc][Aa][Ll] { switch(rand()%2) + { + case 0: printf("Pall Mall"); break; + case 1: printf("Roald Dahl"); break; + } + } +[Aa][Ll][Gg][Oo][Ll] printf("Johnny Ball"); +[Ff][Oo][Rr][Tt][Rr][Aa][Nn] printf("Manfred Mann"); +[Cc][Oo][Bb][Oo][Ll] printf("Albert Hall"); +[Jj]ava printf("Wot a palavah"); +[Ww][Aa][Pp] printf("Pony and trap"); +Stopped printf("'Ad the mockers put on"); +stopped printf("'ad the mockers put on"); +Stopping printf("Putting the mockers on"); +stopping printf("putting the mockers on"); +stops printf("puts the mockers on"); +stop printf("put the mockers on"); +STOP printf("Put The Mockers On"); +[Ll]ondoner printf("Cockney"); +friend { switch(rand()%3) + { + case 0: printf("mucker"); break; + case 1: printf("mate"); break; + case 2: printf("china"); break; + } + } +"a h" printf("an '"); +"A h" printf("An '"); +" h" printf(" '"); +" H" printf(" '"); +" C-" printf(" Bruce Lee-"); +" C " { switch(rand()%4) + { + case 0: printf(" Bruce Lee "); break; + case 1: printf(" Circus Flea "); break; + case 2: printf(" Bumble Bee "); break; + case 3: printf(" Door Key "); break; + } + } +" C." printf(" Circus Flea."); +Th printf("F"); +Wh printf("W"); +wh printf("w"); +aw printf("or"); +" "[BbKkMmPpRrSsWw]ing ECHO; +" "[Bb]ring ECHO; +" "[Ss]ting ECHO; +" "[Ss]wing ECHO; +" "[CcFfSs]ling ECHO; +" Thing" printf(" Fing"); +" thing" printf(" fing"); + +"ing " printf("in' "); +". " { switch(rand()%32) + { + case 0: printf(". I'll get out me spoons. "); break; + case 1: printf(". Yer can't 'ave a knees-up wivout a joanna. "); break; + case 2: printf(". Cor blimey guv, would I lie to you. "); break; + case 3: printf(". I'll make us all a nice cup of tea. "); break; + default: ECHO; break; + } + } +"? " { switch(rand()%3) + { + case 0: printf(", mate? "); break; + case 1: printf(", guv? "); break; + case 2: printf(", squire? "); break; + } + } +"! " { switch(rand()%6) + { + case 0: printf(", cor blimey! "); break; + case 1: printf("! Struth! "); break; + case 2: printf(", guv! "); break; + case 3: printf("! Honest guv! "); break; + case 4: printf(", mate! "); break; + case 5: ECHO; break; + } + } +. printf(yytext); +\n printf("\n"); +%% + +main() +{ + srand(getpid()); + yylex(); +} -- 2.39.2