From 0d0afb25b33c5b6c5cd2432a0448c66f91fb0a09 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 4 May 2013 23:48:11 -0400 Subject: [PATCH] filters (2.49) unstable; urgency=low * scottish: Fix typo. Closes: #688905 * lolcat: New filter. # imported from the archive --- GPL | 340 ++++++++++++++++++ Makefile | 65 ++++ README | 106 ++++++ b1ff | 118 +++++++ censor | 61 ++++ chef | 67 ++++ cockney.l | 191 ++++++++++ debian/TODO | 4 + debian/changelog | 423 ++++++++++++++++++++++ debian/compat | 1 + debian/control | 19 + debian/copyright | 137 ++++++++ debian/docs | 1 + debian/rules | 7 + eleet | 19 + fanboy | 65 ++++ filters.6 | 105 ++++++ fudd | 14 + jethro.l | 265 ++++++++++++++ jibberish | 49 +++ jive.l | 253 +++++++++++++ ken.l | 288 +++++++++++++++ kenny | 384 ++++++++++++++++++++ kraut.dir/destructions | 36 ++ kraut.dir/kraut.c | 25 ++ kraut.dir/kraut.l | 81 +++++ ky00te.dir/README.ky00te | 83 +++++ ky00te.dir/ky00te.lex | 64 ++++ ky00te.dir/ky00te.yacc | 133 +++++++ ky00te.dir/makefile | 21 ++ lolcat | 86 +++++ makesample.sh | 11 + nethackify.dir/makefile | 16 + nethackify.dir/nethackify.c | 87 +++++ nethackify.dir/readme | 9 + newspeak.l | 685 ++++++++++++++++++++++++++++++++++++ nyc.l | 108 ++++++ pirate | 138 ++++++++ rasterman | 101 ++++++ scottish | 51 +++ scramble.dir/Makefile | 5 + scramble.dir/scramble.c | 205 +++++++++++ spammer | 196 +++++++++++ studly | 13 + uniencode | 88 +++++ upside-down | 3 + 46 files changed, 5227 insertions(+) create mode 100644 GPL create mode 100644 Makefile create mode 100644 README create mode 100755 b1ff create mode 100755 censor create mode 100755 chef create mode 100644 cockney.l create mode 100644 debian/TODO create mode 100644 debian/changelog create mode 100644 debian/compat create mode 100644 debian/control create mode 100644 debian/copyright create mode 100644 debian/docs create mode 100755 debian/rules create mode 100755 eleet create mode 100755 fanboy create mode 100644 filters.6 create mode 100755 fudd create mode 100644 jethro.l create mode 100755 jibberish create mode 100644 jive.l create mode 100644 ken.l create mode 100755 kenny create mode 100644 kraut.dir/destructions create mode 100644 kraut.dir/kraut.c create mode 100644 kraut.dir/kraut.l create mode 100644 ky00te.dir/README.ky00te create mode 100644 ky00te.dir/ky00te.lex create mode 100644 ky00te.dir/ky00te.yacc create mode 100644 ky00te.dir/makefile create mode 100755 lolcat create mode 100644 makesample.sh create mode 100644 nethackify.dir/makefile create mode 100644 nethackify.dir/nethackify.c create mode 100644 nethackify.dir/readme create mode 100644 newspeak.l create mode 100644 nyc.l create mode 100755 pirate create mode 100755 rasterman create mode 100755 scottish create mode 100644 scramble.dir/Makefile create mode 100644 scramble.dir/scramble.c create mode 100755 spammer create mode 100755 studly create mode 100755 uniencode create mode 100755 upside-down diff --git a/GPL b/GPL new file mode 100644 index 0000000..d60c31a --- /dev/null +++ b/GPL @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..578678e --- /dev/null +++ b/Makefile @@ -0,0 +1,65 @@ +LEX = flex +BUILD = jethro kraut cockney jive nyc ken ky00te newspeak nethackify scramble +OTHER = eleet b1ff chef jibberish upside-down rasterman studly fudd \ + censor spammer uniencode pirate kenny scottish fanboy +CFLAGS = -O2 -lfl +export CFLAGS +INSTALL_PROGRAM = install + +# DEB_BUILD_OPTIONS suport, to control binary stripping. +ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) +INSTALL_PROGRAM += -s +endif + +# And debug building. +ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS))) +CFLAGS += -g +endif + +all: $(OTHER) $(BUILD) samples + +install: $(BUILD) $(OTHER) + install -d $(DESTDIR)/usr/games + $(INSTALL_PROGRAM) $(BUILD) $(DESTDIR)/usr/games/ + install $(OTHER) $(DESTDIR)/usr/games/ + install -d $(DESTDIR)/usr/share/man/man6 + install -m 0644 filters.6 $(DESTDIR)/usr/share/man/man6 + cd $(DESTDIR)/usr/share/man/man6 && \ + $(foreach prog,$(BUILD) $(OTHER),ln -s filters.6 $(prog).6;) + +samples: $(BUILD) $(OTHER) + -rm -f SAMPLES + PATH=.:$$PATH; export PATH; echo $(BUILD) $(OTHER) | xargs -n 1 sh makesample.sh + +clean: + $(RM) -f core *.o *~ $(BUILD) SAMPLES + cd ky00te.dir && make clean + rm -f kraut.dir/lex.yy.c + cd nethackify.dir && make clean + cd scramble.dir && make clean + +.SUFFIXES: .l + +.l: + $(RM) $*.c + $(LEX) -t $< > $*.c + $(CC) -o $@ $*.c $(CFLAGS) + $(RM) $*.c + +.SUFFIXES: .dir + +.dir: + cd $<; make + +ky00te: + cd ky00te.dir && make + +kraut: + cd kraut.dir && lex kraut.l + cd kraut.dir && $(CC) kraut.c lex.yy.c -o ../kraut + +nethackify: + cd nethackify.dir && make + +scramble: + cd scramble.dir && make diff --git a/README b/README new file mode 100644 index 0000000..5b084af --- /dev/null +++ b/README @@ -0,0 +1,106 @@ +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, along with many, +many more. + +http://kitenet.net/~joey/code/filters + +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: + +eleet: + This is the simplest filter to figure out. The letters a-z of + the alphabet are replaced with the following letters: + 4 b c d 3 f g h 1 j |< l /\/\ /\/ 0 p q r 5 + u \/ \/\/ >< y z + Note that the equivalent translation is done on upper-case letters. + +fudd: + + This one is trivial too. A few transpositions happen differently if + the letter is at the end of the word or not, and I think I found + all the transpositions with only a few paragraphs of sample output. + The only weird thing is that 'n.' is changed to "n, uh-hah-hah-hah." + (Works well with sentances ending in "gun." ..) + +chef: + Personally my favorite filter. This took a bit of work to figure + out, and I doubt I have everything correct. Note that due to a bug + or an odd feature of the original program, it doesn't seem to think + that the first letter of the first word is really the first letter + of a word and so some of the words below don't trigger for that first + word. I did not emulate this behavior because I think it's probably a + bug. + + The word "bork" is never changed, no matter what any of these + rules may say. Neither is "Bork". + + The following translations only happen to letters that are the first + letter of a word of at least 2 letters in size: + o -> oo + O -> Oo + + These happen to letters that are not the last letter of a word: + a -> e + A -> e + + These translations only happen if the letter is not the first letter + of a word: + f -> ff + i -> ee (but only the first `i' per word) + o -> u + u -> oo + + These translations always happen: + v -> f + V -> F + w -> v + W -> V + an -> un + An -> Un + au -> oo + Au -> Oo + + Any occurrence of "e" at the end of a word is changed to "e-a". + + Any occurrence of "e" and the beginning of a word is changed to "i". + Same with capitals. + + Any occurrence of "the" is changed to "zee", any occurrence of + "The", to "Zee". + + Any occurrence of "tion" in a word, to "shun". + + Any "th" at the end of a word is changed to "t". + + Any "en" at the end of a word is changed to "ee". + + Any "ow" at the end of a word is changed to "oo". + + And of course, after any `.', `?', or `!' that is at the end of a + line, the Chef prints out a new line, and then the famous + "Bork Bork Bork!", and then another newline. + + Known bugs in this implementation: + - says "frunch", not "french". + - still quite buggy in general. + +b1ff: + Unlike the other filters, b1ff does not try to be an exact duplicate + of its predecessor. + + After upper-casing everything, b1ff does some word and sub-word + substitutions, most of them misspellings. + + B1ff also changes punctuation - All commas become periods; all + semicolons, commas. Question and exclamation marks are changed to + things like "!!!!1!" and "?!?!?!". It looks like the original filter + decided how long a sequence to print based on the text input before + the end of sentence. I took a simpler route and just randomized it. + +Collected and written by Joey Hess diff --git a/b1ff b/b1ff new file mode 100755 index 0000000..0f1ad43 --- /dev/null +++ b/b1ff @@ -0,0 +1,118 @@ +#!/usr/bin/perl -p +# B1FF filter. +# Copyright 1999 by Joey Hess under the terms of the GNU GPL. + +# I use an array, not a hash. because order is important. +@trans_table=( + '\bEVERYONE\b' => 'EVRY 1', + '\bEVERYBODY\b' => 'EVRY BUDY', + '\bEVERY\b' => 'EVRY', + '\bONE\b' => '1', + '\bAND\b' => '+', + '\bYOU' => 'U', + '\bITS\b' => 'IT"S', + '\bIT\'S\b' => 'ITS', + '\bIS\b' => 'IZ', + '\bLINUX\b' => 'LINUS', + '\bUNIX\b' => 'THE MANEFRA1M O/S', + '\bWINDOWS\b' => 'WINDOWZ (IT RULEZ MAN!)', + '\bYOU\'RE\b' => 'YOUR', + '\bTHEM\b' => 'THUM', + '\bHERE\b' => 'HERE', + '\bTHEY\'RE\b' => 'THE1R', + '\bTHEIR\b' => 'THERE', + '\bWAS\b' => 'WUZ', + '\bMACINTOSH\b' => 'IMAC', # too 90's? + '\bVERY\b' => 'TOTALLY', + '\bCOMPUTER\b' => 'VIC-20', + '\bWHETHER\b' => 'WHETHUR', + '\b(?:H|CR)ACKER\b' => 'KEWL HACKER D00D!', + '\bOF\b' => 'UV', + '\bGNU\b' => 'NEW', + '\bQUITE\b' => 'REAL', + '\bFREE\b' => 'FREE!', + + 'HOME' => 'HUM', + 'COME' => 'CUM', + 'MICRO' => 'MIKRO', + 'GOVERN' => 'GUVERN', + 'PERSON' => 'D00D', + 'SOME' => 'SUM', + 'WRITE' => 'RITE', + 'REAL' => 'REEL', + 'LITE' => 'L1TE', + 'BIAN' => 'B1AN', + 'TION' => 'SHUN', + 'FOR' => '4', + 'TO' => '2', + 'ATE' => '8', + '\b2TALLY\b' => 'TOTALY', # fix from line above + 'LL' => 'L', + 'OO' => '00', + 'MATE' => 'M8', + 'ER' => 'UR', + 'S+\b' => 'Z', + 'KN' => 'N', + 'IE' => 'EI', +); + +$_=uc; +s/;/,/g; +s/'//g; + +while (@trans_table) { + $key=shift @trans_table; + $value=shift @trans_table; + s/$key/$value/g; +} + +s/(\!+)/$1.make_exclimation()/eg; +s/(\?+)/$1.make_question()/eg; +s/I/rand 3 > 2 ? '1' : 'I'/eg; # change 1/3 of I's to 1's + +@punct=('.','!',','); + +s/\. /. /g; +s/\./$punct[int(rand 3)]/eg; +s/\,/./g; + + +# b1ff can't hold down on shift too well!!!!!!!1! +sub make_exclimation { + my $length=shift || int(rand 5); + my $ret='!'; + my $last=0; + for (1..$length) { + if (! $last && int(rand 3) eq 2) { + $ret.="1"; + $last=1; + } + else { + $ret.="!"; + $last=0; + } + } + return $ret; +} + +# ask questions excitedly?!?!?!?! +sub make_question { + my $length=shift || int(rand 5) + 1; + my $ret=''; + my $last=0; + while (length($ret) < $length) { + if (! $last && int(rand 5) > 2) { + $ret.="?!"; + $last=1; + } + elsif (! $last && int(rand 5) > 3) { + $ret.="?1"; + $last=1; + } + else { + $ret.="?"; + $last=0; + } + } + return $ret; +} diff --git a/censor b/censor new file mode 100755 index 0000000..36ea3ed --- /dev/null +++ b/censor @@ -0,0 +1,61 @@ +#!/usr/bin/perl +# Censor filter. +# Copyright 2002 by Joey Hess under the terms of the GNU GPL. + +# Yes, this program is self-modifying code, if you want it to be. +if (exists $ENV{ADD_WORD}) { + open(IN, $0) || die "cannot read myself"; + @lines=; + close IN; + open OUT, ">$0" || die "cannot write myself"; + for (@lines) { + print OUT $_; + if (/^__DATA__\n$/) { + open(DATAOUT, "|sort|uniq|column >> $0"); + $ENV{ADD_WORD} =~ y/n-za-m/a-z/; + print DATAOUT "$ENV{ADD_WORD}\n"; + print DATAOUT join("\n", + map { chomp; split ' ', $_ } ); + close DATAOUT; + exit; + } + } +} + +$censored = join("|", reverse sort { $a cmp $b } + grep { length $_ } + map { chomp; y/a-z/n-za-m/; split ' ', $_ } ); + +while (<>) { + s/\b($censored)ed/CENSORED/ig; # don't say "CENSOREDed" + s/\b($censored)/CENSORED/ig; + print $_; +} + +__DATA__ +ahqr enaql gjng pbpx t-fcbg +anxrq encr grng pbzrvat t\f+fcbg +avccyr erne guebng pbzvat tebva +bcravat fangpu gvg pebgpu ubbgre +beny fchax gvggl penc ubeal +betl fcrez gvggvr penpx ubyr +betnfz fcuvapgre hgrehf pernz uhzc +certanag fghq ihyin phag unaqwbo +cevpx fgnss intvan phz urnq +chff fhpx ivetva phzzvat wvfz +chffl fjnyybj ivoengbe pnzr xabo +chffvrf fperj jbzo preivk xvff +chovp frk jrg pureel ybir +chqraqhz frkhny juber pyvg ybire +chzc frrq kkk pyvgbevf ybirq +cnagvrf frzra nany pyvggl ybnq +crargengr funsg nerbyn pyvznk ynovn +crargengrq funt nff qevyyrq ynvq +cravf funttvat nffubyr qrsybjre yrfovna +crgre fuvg obbo qvpx yvcf +crpxre fvrt\furvy oernfg qvyqb znfgheong +cunyyhf fyhg ohgg rebgvp znfgheongr +cvff fyhggvfu ohggbpx rerpgvba znfgheongvat +ebfrohq fyvg onyy rkcbfrq znzznel +ebq gbathr ovgpu shpx znzznevrf +ehg gbby oybj snpvny diff --git a/chef b/chef new file mode 100755 index 0000000..57c3d65 --- /dev/null +++ b/chef @@ -0,0 +1,67 @@ +#!/usr/bin/perl -p +# Swedish Chef filter. Bork Bork Bork! +# Copyright 1999 by Joey Hess under the terms of the GNU GPL. + +# Note that the order of the commands in this program is very important! + +# Change 'e' at the end of a word to 'e-a', but don't mess with the word +# "the". +s{(\w+)e(\b)}{ + if (lc($1) ne 'th') { + "$1e-a$2" + } + else { + "$1e$2" + } +}eg; + +# Stuff that happens at the end of a word. +s/en(\b)/ee$1/g; +s/th(\b)/t$1/g; + +# Stuff that happens if not the first letter of a word. +s/(\w)f/$1ff/g; + +# Change 'o' to 'u' and at the same time, change 'u' to 'oo'. But only +# if it's not the first letter of the word. +tr/ou/uo/; +s{(\b)([uo])}{ + $1 . $2 eq 'o' ? 'u' : 'o' +}eg; +# Note that this also handles doubling "oo" at the beginning of words. +s/o/oo/g; +# Have to double "Oo" seperatly. +s/(\b)O(\w)/$1Oo$2/g; +# Fix the word "bork", which will have been mangled to "burk" +# by above commands. Note that any occurence of "burk" in the input +# gets changed to "boork", so it's completly safe to do this: +s/\b([Bb])urk\b/$1ork/g; + +# Stuff to do to letters that are the first letter of any word. +s/\be/i/g; +s/\bE/I/g; + +# Stuff that always happens. +s/tiun/shun/g; # this actually has the effect of changing "tion" to "shun". +s/the/zee/g; +s/The/Zee/g; +tr/vVwW/fFvV/; + +# Stuff to do to letters that are not the last letter of a word. +s/a(?!\b)/e/g; +s/A(?!\b)/E/g; + +s/en/un/g; # this actually has the effect of changing "an" to "un". +s/En/Un/g; # this actually has the effect of changing "An" to "Un". +s/eoo/oo/g; # this actually has the effect of changing "au" to "oo". +s/Eoo/Oo/g; # this actually has the effect of changing "Au" to "Oo". + +# Change "ow" to "oo". +s/uv/oo/g; + +# Change 'i' to 'ee', but not at the beginning of a word, +# and only affect the first 'i' in each word. +s/(\b\w[a-hj-zA-HJ-Z]*)i/$1ee/g; + +# Special punctuation of the end of sentances but only at end of lines. +s/([.?!])$/$1\nBork Bork Bork!/g; diff --git a/cockney.l b/cockney.l new file mode 100644 index 0000000..f6d0ad2 --- /dev/null +++ b/cockney.l @@ -0,0 +1,191 @@ +%{ +/* + * Lex filter to transform plain English into Cockney English. + * No racial or societal slurs are intended. For amusement only. + * + * Copyright 1986 by Daniel Klein. + * + * Reproduction permitted so long as this notice is retained. + */ +%} + +BW [ \t\n] +SP [ \t]+ +EW [ \t.,;!\?$] + +%Start junk + +%% + +%{ + void eos() { + if (yytext[yyleng-1] == '.') + dintI(); + else + unput(yytext[yyleng-1]); + } + + void plastc() { + unput(yytext[yyleng-1]); + } +%} + +. { srandom(time(0L)); unput(yytext[0]); BEGIN 0; } +{BW}[Tt]he{EW} { ECHO; bloody(); } +{BW}[Ss]teal{EW} { printf("%c%cick",yytext[0],yytext[1]-5); + eos(); + } +{BW}[Ss]tole{EW} { printf("%c%cicked",yytext[0],yytext[1]-5); + eos(); + } +{BW}tired pooped(); +{BW}were{EW} | +{BW}was{EW} { printf("%cwuz",yytext[0]); eos(); } +[Hh]ello printf("'%cllo", caseify('u')); +{BW}[Hh] printf("%c'",yytext[0]); +{BW}[Yy]our{EW} { printf("%.2ser",yytext); eos(); } +{BW}it{EW} { printf("%.2s'",yytext); eos(); } +{BW}go{EW} { printf("%.2sow",yytext); eos(); } +{BW}and{EW} { printf("%c'n'",yytext[0]); eos(); } +{BW}my{EW} { printf("%.2se",yytext); eos(); } +{BW}th(is|at){EW} { printf("%.5s", yytext); eos(); } +{BW}[Ww]e{SP}went{EW} | +{BW}[Ww]e{SP}had{EW} | +{BW}[Ww]e{SP}did{EW} { printf("%.*s",yyleng-1,yytext); + set_did(2); + eos(); + } +{BW}I{SP}went{EW} | +{BW}I{SP}had{EW} | +{BW}I{SP}did{EW} { I(); + printf(" did"); + set_did(1); + eos(); + } +{BW}I{EW} { I(); eos(); } + +[Yy]ou{SP}[^aeiouy] { printf("%c'", yytext[0]); plastc(); } +[Ww]hat{SP}are{EW} { printf("%cotta", yytext[0]); eos(); } + +{BW}other | +[MmNnRr]other printf("%cuvver",yytext[0]); +[MmSs]outh printf("%cowf", yytext[0]); +[cYy]outh printf("%coof", yytext[0]); +[^o]uth printf("%.2sf",yytext); +{BW}th[^e] | +[AaEeIiOo]th[^em] { printf("%cf",yytext[0]); plastc(); } +oothe | +e[ei]the { printf("%c%cve", yytext[0], yytext[0]); } +ooth | +eeth { printf("%c%cf", yytext[0], yytext[0]); } +[aei]the { printf("%cvv",yytext[0]); plastc(); } +th putchar('v'); +a[km]e{EW} { printf("i%ce",yytext[1]); eos(); } +[^r][Oo]ld printf("%.2swld",yytext); +[^AaEeIiOoUu][uo]nd[a-z] printf("%cunn%c",yytext[0],yytext[yyleng-1]); +ing{EW} { printf("in'"); eos(); } +[^dg]get+[^h] printf("%cge'%c",yytext[0],yytext[yyleng-1]); +ail printf("aiw"); +any printf("enny"); +[rSs]ay{EW} { printf("%cigh",yytext[0]); eos(); } +way printf("why"); +[BbHh]it{EW} { printf("%ci'",yytext[0]); eos(); } +ait{EW} { printf("ite"); eos(); } +ime{EW} { printf("oime"); eos(); } +[^e]ize[^n] printf("%coize%c",yytext[0],yytext[yyleng-1]); +[^e]ight printf("%coit",*yytext); +[a-z]"?" { *(yytext+1) = ','; + printf("%s roit?",yytext); + clear_did(); + } +[a-z]"." { printf("%c", yytext[0]); dintI(); } +\n printf("\n"); + +%% + +caseify(c) +char c; +{ + if (yytext[0] <= 'Z') + return (c - ' '); + else + return (c); +} + + +I() +{ +/* extern long random(); */ + + if (random() % 100 < 20) + printf("%cOy",yytext[0]); + else + printf("%cI",yytext[0]); +} + +static short b_count = 0; +static short b_which = 0; + +bloody() +{ + if (b_count++ % 2 == 0) { + switch (b_which++ % 4) { + case 0: printf("bloody "); break; + case 1: printf("flinkin' "); break; + case 2: printf("bleedin' "); break; + case 3: printf("soddin' "); break; + } + } +} + +static short did = 0; + +set_did(val) +{ + did = val; +} + +clear_did() +{ + did = 0; +} + +dintI() +{ +/* extern long random(); */ + + if ((did == 1) && (random() % 100 < 50)) + printf(", didn'I?"); + else if ((did == 2) && (random() % 100 < 50)) + printf(", din't we?"); + else + printf("."); + clear_did(); +} + +pooped() +{ +/* extern long random(); */ + + switch (random() % 3) { + case 0: + printf("%cknackered", yytext[0]); + break; + case 1: + printf("%cshagged out", yytext[0]); + break; + case 2: + printf("%cdone in", yytext[0]); + break; + } +} + +expletive() +{ +/* +Blimey +Stright a light +'Strewth +Cor blimey +*/ +} diff --git a/debian/TODO b/debian/TODO new file mode 100644 index 0000000..ad4e968 --- /dev/null +++ b/debian/TODO @@ -0,0 +1,4 @@ +* continue to make the chef filter more similar to the old one +* write and collect more filters +* does anyone have an asci-art cow font? +* rms filter, though vrms already does a good job.. diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..1af2543 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,423 @@ +filters (2.49) unstable; urgency=low + + * scottish: Fix typo. Closes: #688905 + * lolcat: New filter. + + -- Joey Hess Sat, 04 May 2013 23:48:11 -0400 + +filters (2.48) unstable; urgency=low + + * Mention that some filters support reading from input files. + Closes: #569764 + + -- Joey Hess Sun, 06 Feb 2011 00:01:44 -0400 + +filters (2.47) unstable; urgency=low + + * Patch from Anssi Hannula to avoid warnings when + compiling with -Werror=format-security. + * scramble: New filter that scambles the inner letters of + words. Contributed by Andrew J. Buehler. + * Converted debian/copyright to machine parseable format. + + -- Joey Hess Sat, 11 Jul 2009 16:47:23 -0400 + +filters (2.46) unstable; urgency=low + + * fanboy: Improve docs and remove from SAMPLES. Closes: #496588 + + -- Joey Hess Sun, 26 Oct 2008 23:44:04 -0400 + +filters (2.45) unstable; urgency=low + + * Use debhelper v7; rules file minimisation to 3 lines. + + -- Joey Hess Tue, 22 Jul 2008 00:25:48 -0400 + +filters (2.44) unstable; urgency=low + + * Work around dpkg bug #476138. Closes: #475979 + * Use CC consistently. + + -- Joey Hess Mon, 14 Apr 2008 13:26:53 -0400 + +filters (2.43) unstable; urgency=low + + * Added the fanboy filter. + + -- Joey Hess Thu, 25 Oct 2007 04:58:44 -0400 + +filters (2.42) unstable; urgency=low + + * Moved from subversion to git. + + -- Joey Hess Fri, 19 Oct 2007 20:37:33 -0400 + +filters (2.41) unstable; urgency=low + + * pirate: Roll r's. Also, conjugate 'is' in present tense, and add some + more phrases. Closes: #443213 + + -- Joey Hess Wed, 19 Sep 2007 14:26:41 -0400 + +filters (2.40) unstable; urgency=low + + * Update url to web page in README. + * Add scottish filter by Adam Borowski. Closes: #436168 + + -- Joey Hess Thu, 09 Aug 2007 17:19:14 -0700 + +filters (2.39) unstable; urgency=low + + * Add kenny filter. Closes: #317656 + + -- Joey Hess Mon, 20 Feb 2006 16:27:25 -0500 + +filters (2.38) unstable; urgency=low + + * Munged accented characters in man page. + + -- Joey Hess Sun, 18 Dec 2005 17:31:38 -0500 + +filters (2.37) unstable; urgency=low + + * Suggest bsdgames, which contains pig and rot13. + + -- Joey Hess Wed, 7 Sep 2005 23:36:38 -0400 + +filters (2.36) unstable; urgency=low + + * Impress all yer maties on talk like a pirate day with th' new priate + filter, by Dougal Campbell, to be sure. + * Retroactively spiced up th' changelog. Shiver me timbers! + + -- Joey Hess Thu, 25 Aug 2005 23:28:25 -0400 + +filters (2.35) unstable; urgency=low + + * Ad| nethackify filtcr. Closes: #317656 + * Add automatic webpage update gunk. + + -- Joey Hess Thu, 25 Aug 2005 22:24:29 -0400 + +filters (2.34) unstable; urgency=low + + * Add uniencode filter. Because υɳіϲоⅾе is fun. + * Fix filters man page to escape hyphens. Because υɳіϲоⅾе is fun. + + -- Joey Hess Sat, 6 Nov 2004 13:37:51 -0500 + +filters (2.33) unstable; urgency=low + + * Better flex fixups; make sure to link with -lfl even if building + indivitually, and move stuff that uses unput into %{ %} delimited blocks + in rules section. + + -- Joey Hess Tue, 15 Apr 2003 15:06:25 -0400 + +filters (2.32) unstable; urgency=low + + * Deal with the new flex 2.5.31 as follows: + - Add main and yywrap functions, though they were not needed before. + - Call yyunput instead of unput macro, as the macro uses yytext_ptr, + which flex undefes before the bottom set of functions are defined. + Closes: #189040 + * Various other fixes to build without warnings. + + -- Joey Hess Mon, 14 Apr 2003 23:39:26 -0400 + +filters (2.31) unstable; urgency=low + + * censor: corrected spelling of pyvgbevf, Closes: #172976 + + -- Joey Hess Sat, 22 Feb 2003 14:03:18 -0500 + +filters (2.30) unstable; urgency=low + + * Falk Hueffner provided a patch to make kraut work on alpha. + Closes: #169256 + + -- Joey Hess Thu, 21 Nov 2002 00:16:40 -0500 + +filters (2.29) unstable; urgency=low + + * Added certain German phrase to the censor filter. If Germans want to send + me censored German phrases, I will be glad to continue adding them to this + filter. + + -- Joey Hess Fri, 15 Nov 2002 13:35:51 -0500 + +filters (2.28) unstable; urgency=low + + * Fixed a typo in kraut. + * Note in man page that it's a _bad_ German accent. Think 1940's + American propiganda movies. Closes: #169163 + + -- Joey Hess Fri, 15 Nov 2002 11:52:48 -0500 + +filters (2.27) unstable; urgency=low + + * Added a censor filter. + * Added a spammer filter which generates spamassassin-triggering + pseudo-spam from input. + * Updated eleet filter (which should perhaps be renamed to just 'leet') + to the standards of irc circa mid 2002. + * Make jibberish filter only run text through 3 to 8 of the other filters. + * Various improvements. + + -- Joey Hess Sun, 3 Nov 2002 16:37:12 -0500 + +filters (2.26) unstable; urgency=low + + * Don't use dh_installmanpages. + + -- Joey Hess Thu, 13 Jun 2002 18:27:53 -0400 + +filters (2.25) unstable; urgency=low + + * Fixed debhelper build-dep. + + -- Joey Hess Sat, 1 Jun 2002 22:41:07 -0400 + +filters (2.24) unstable; urgency=low + + * debhelper v4 + * DEB_BUILD_OPTS support + + -- Joey Hess Sat, 1 Jun 2002 16:45:49 -0400 + +filters (2.23) unstable; urgency=low + + * Patch from Seneca to correct newspeak's + handling of double quotes preeceeded by punctuation and followed by a + blank line. Closes: #146769 + + -- Joey Hess Sun, 19 May 2002 19:52:06 -0400 + +filters (2.22) unstable; urgency=low + + * Something I already fixed in CVS, Closes: #124617 + * debhelper v3. + + -- Joey Hess Mon, 17 Dec 2001 22:20:35 -0500 + +filters (2.21) unstable; urgency=low + + * Wrote elmer fudd filter in perl, replacment for a long-removed + lex filter of uncertian authorship and copyright. Closes: #109157 + + -- Joey Hess Thu, 4 Oct 2001 19:32:00 -0400 + +filters (2.20) unstable; urgency=low + + * Woo hoo! JWZ has placed newspeak under a BSD-ish license, so it moves + in from filters-nonfree. Which is now empty, and will be removed. + * AdDed StudLy cAps FiltEr bY NiCk PHillIps . + + -- Joey Hess Mon, 6 Aug 2001 20:38:49 -0400 + +filters (2.19) unstable; urgency=low + + * Fixed jibberish makesamples run to not use installed versions of the + filters. + + -- Joey Hess Sat, 14 Jul 2001 23:44:45 -0400 + +filters (2.18) unstable; urgency=low + + * ky00te is free! That leaves only newspeak in filters-nonfree. + * A big thanks to Edward Betts for contacting authors. + * Fixed echo -n bashism in SAMPLES construction. + * rasterman: Added flim! + + -- Joey Hess Sat, 30 Jun 2001 18:51:39 -0400 + +filters (2.17) unstable; urgency=low + + * ken: WAP fixes. + + -- Joey Hess Mon, 11 Jun 2001 16:35:38 -0400 + +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 + + -- Joey Hess Wed, 10 Jan 2001 23:48:00 -0800 + +filters (2.14) unstable; urgency=low + + * hahaha. addde a rasterman filter. (nto just "raster" as i woryr about + namespaec pollution.) + + -- Joey Hess Mon, 27 Nov 2000 20:00:28 -0800 + +filters (2.13) unstable; urgency=low + + * cockney, jive, and nyc filters are now GPL'd, moved from -nonfree + package. + + -- Joey Hess Wed, 22 Nov 2000 19:04:08 -0800 + +filters (2.12) unstable; urgency=low + + * Use debhelper v2. + + -- Joey Hess Mon, 25 Sep 2000 15:06:11 -0700 + +filters (2.11) unstable; urgency=low + + * Corrected the man page, which was misrepresenting me as the author of + some programs I didn't write. + + -- Joey Hess Tue, 29 Aug 2000 22:58:02 -0700 + +filters (2.10) unstable; urgency=low + + * upside-down: 5 and 2 are the best available upside-down versions of + themselves. I had it backwards. + + -- Joey Hess Thu, 29 Jun 2000 16:23:59 -0700 + +filters (2.9) unstable; urgency=low + + * Fixed "burk" to "bork" globally. Closes: #52589 + + -- Joey Hess Sun, 12 Dec 1999 14:14:41 -0800 + +filters (2.8) unstable; urgency=low + + * makesample.sh is now careful to make sure each program is executable + before running it. Closes: #50985 + * I also set -e the script. + + -- Joey Hess Mon, 22 Nov 1999 14:09:43 -0800 + +filters (2.7) unstable; urgency=low + + * A much better synopsis. + + -- Joey Hess Tue, 9 Nov 1999 00:06:57 -0800 + +filters (2.6) unstable; urgency=low + + * FHS + + -- Joey Hess Fri, 10 Sep 1999 21:25:47 -0700 + +filters (2.5) unstable; urgency=low + + * eleet: w -> \/\/ + * Spelling correction patch from Edward Betts + (closes: #38850) + + -- Joey Hess Thu, 3 Jun 1999 13:03:02 -0700 + +filters (2.4) unstable; urgency=low + + * chef: say "knooeeng" for "knowing", and in general say "oo" for "ow". + + -- Joey Hess Wed, 19 May 1999 17:20:07 -0700 + +filters (2.3) unstable; urgency=low + + * Added kraut filter (free version found). + + -- Joey Hess Wed, 17 Mar 1999 15:52:05 -0800 + +filters (2.2) unstable; urgency=low + + * fixed Makefile to add . to PATH before running makesample.sh, because it + called jibberish, which looks only in /usr/games for the filters, and if + you're building filters w/o the package installed, they won't be there + and the build will fail. Whew! (closes: #33758) + + -- Joey Hess Fri, 26 Feb 1999 00:17:24 -0800 + +filters (2.1) unstable; urgency=low + + 'umop ap!sdn fxaf sujnf `77am y)!ym `jaf7!j umop ap!sdn pappe * + + -- Joey Hess Sat, 20 Feb 1999 18:22:43 -0800 + +filters (2.0) unstable; urgency=low + + * Re-wrote the eleet, chef, b1ff filters in perl, dropped all the rest + (except jethro); they will be in filters-nonfree now. This was done + due to copyright problems in the original filters. + * Fixes important bug #32333 + + -- Joey Hess Sun, 24 Jan 1999 13:13:17 -0800 + +filters (1.8) unstable; urgency=low + + * Added jibberish meta-filter by Raul Miller . + (#24677) + + -- Joey Hess Fri, 4 Dec 1998 15:18:09 -0800 + +filters (1.7) unstable; urgency=low + + * Renamed mb to marc-barrett to eliminate namespace pollution. + + -- Joey Hess Wed, 15 Apr 1998 00:23:38 -0700 + +filters (1.6) unstable; urgency=low + + * 4dd3d 3l33t f1lt3r, th4nk5 t0 j3r3my w0rr3ll5 . + + -- Joey Hess Fri, 6 Mar 1998 11:41:29 -0800 + +filters (1.5) unstable; urgency=low + + * Updated standards-version. + + -- Joey Hess Mon, 9 Feb 1998 13:38:55 -0800 + +filters (1.4) unstable; urgency=low + + * Use debhelper. + + -- Joey Hess Sat, 7 Feb 1998 19:38:35 -0800 + +filters (1.3) unstable; urgency=low + + * Libc6. + * Added man pages. #11318 + + -- Joey Hess Wed, 16 Jul 1997 13:31:07 -0400 + +filters (1.2) frozen unstable; urgency=low + + * Fixed bug #8329 (buck segfaulted if it encountered C[aou] or R[aeiou] in + input.) + * Routine update of debian/rules: + Run dpkg-gencontrol after debstd, and delete substvars during clean. + + -- Joey Hess Tue, 8 Apr 1997 20:59:12 -0400 + +filters (1.1) unstable; urgency=low + + * Changed version number to 1.1, because there was some confusion if this + was a debian-only package. It is, so I've removed the debian revision + number. + + -- Joey Hess Tue, 24 Dec 1996 20:35:51 -0500 + +filters (1.0-2) unstable; urgency=low + + * New email address. + * Use debmake. + + -- Joey Hess Tue, 24 Dec 1996 15:40:55 -0500 + +filters (1.0-1) unstable; urgency=low + + * First release. + + -- Joey Hess Sat, 28 Sep 1996 00:55:40 -0400 diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..7f8f011 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +7 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..3865468 --- /dev/null +++ b/debian/control @@ -0,0 +1,19 @@ +Source: filters +Section: games +Priority: optional +Build-Depends: debhelper (>= 7), flex, bison | byacc | btyacc, dpkg-dev (>= 1.9.0) +Maintainer: Joey Hess +Standards-Version: 3.9.1 +Vcs-Git: git://git.kitenet.net/filters +Homepage: http://kitenet.net/~joey/code/filters/ + +Package: filters +Architecture: any +Conflicts: filters-nonfree +Replaces: filters-nonfree +Suggests: bsdgames +Depends: ${shlibs:Depends}, ${misc: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. + This includes such favorites as B1FF and the Swedish Chef, and a wide + range of others. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..900ee9e --- /dev/null +++ b/debian/copyright @@ -0,0 +1,137 @@ +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Source: Gathered from many sources, including old usenet posts in the 90's. + +Files: * +Copyright: 1996-2009 Joey Hess +License: GPL-2+ + The full text of the GPL is distributed as GPL in filters's source, + and is distributed in /usr/share/common-licenses/GPL-2 on Debian systems. + +Files: jethro.l +Copyright: 1993 Duane Paulson +License: other + ** Public domain. Use at your own risk. Y'all come back now, heah? + +Files: kraut.dir/* +Copyright: 1989 John Sparks +License: other + /* This is in the public domain. Do with it as you will. *\ + +Files: cockney.l jive.l nyc.l +Copyright: 1986 Daniel V Klein +License: GPL + Daniel confirmed the copyright in this email: + . + From: Daniel V Klein + Date: Wed, 22 Nov 2000 22:00:50 -0500 + To: Joey Hess + Subject: Re: filters GPL'd + . + That is so. Have fun (FWIW, I have done some rewriting on them - they are + now in Perl, but still need some work...) + . + -Dan + . + > I've been told that you have changed the copyright of the cockney, jive + > and nyc filters to the GPL? Is that correct? I'd love to move them into + > Debian proper. + +Files: rasterman +Copyright: 1997 Zachary Beane +License: GPL-2 + +Files: ken.l +Copyright: Stephen K Mulrine +License: other + The ken filter is now in the public domain. Its author confirmed the + new license 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. + +Files: ky00te.dir/* +Copyright: 1994 Brent E. Edwards +License: GPL-2 + The ky00te filter is now relicensed under the GPL. Its author + confirmed the new license in this email: + . + From: Brent Edwards + Date: Sat, 30 Jun 2001 09:37:53 -0700 + To: Edward Betts + Subject: Re: Is this the author of the ky00te filter? + . + Dear Edward, + You have my permission to put the ky00te filter into the GNU GPL + license. (Though the license will be far longer than the program itself!) + . + -- Brent Edwards + +Files: newspeak.l +Copyright: 1991 Jamie Zawinski +License: other + The newspeak filter is now relicensed under a BSD-like copyright. Its + author established the new copyright in this email: + . + From: Jamie Zawinski + Date: Mon, 06 Aug 2001 16:17:02 -0700 + To: Joey Hess + Subject: Re: copyright of newspeak filter + . + Hey there -- I'm cleaning out old mail, and don't remember if I replied + to this or not. Anyway, in case I didn't -- feel free to slap this + license atop the newspeak script (it's BSD-like, so that should work + for you.) + . + Copyright (c) 1991 Jamie Zawinski + . + Permission to use, copy, modify, distribute, and sell this + software and its documentation for any purpose is hereby granted + without fee, provided that the above copyright notice appear in + all copies and that both that copyright notice and this + permission notice appear in supporting documentation. No + representations are made about the suitability of this software + for any purpose. It is provided "as is" without express or + implied warranty. + +Files: studly +Copyright: Nick Phillips +License: other + # just for reference, you may do whatever you like with this file. + +Files: nethackify +Copyright: 2004 G�kan Seng� +License: GPL-2 + +Files: pirate +Copyright: 2003 Dougal Campbell +License: GPL-2 + Converted from a php version in the funfilters. + +Files: kenny +Copyright: + 2001 Christian Garbs + 2002 Alan Eldridge +License: Artistic + On Debian systems, the full text of the Artistic license can be found in + /usr/share/common-licenses/Artistic + +Files: scottish +Copyright: 2007 Adam Borowski +License: GPL-3+ + The full text of the GPL version 3 can be found in + /usr/share/common-licenses/GPL-3 on Debian systems. + +License: GPL-2 + The full text of the GPL is distributed as GPL in filters's source, + and is distributed in /usr/share/common-licenses/GPL-2 on Debian systems. diff --git a/debian/docs b/debian/docs new file mode 100644 index 0000000..cf662ef --- /dev/null +++ b/debian/docs @@ -0,0 +1 @@ +README SAMPLES ky00te.dir/README.ky00te diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..bda6f51 --- /dev/null +++ b/debian/rules @@ -0,0 +1,7 @@ +#!/usr/bin/make -f +%: + dh $@ + +# Not intended for use by anyone except the author. +announcedir: + @echo ${HOME}/src/joeywiki/code/filters/news diff --git a/eleet b/eleet new file mode 100755 index 0000000..9e0fb77 --- /dev/null +++ b/eleet @@ -0,0 +1,19 @@ +#!/usr/bin/perl -p +# Eleet filter, Copyright 1999,2002 by Joey Hess under the terms of the GNU GPL. +BEGIN { + # abcdefghijklmnopqrstuvwxyz + $transstring="4bcd3fgh1jklmn0pqr5tuvwxyz"; + $t="tr/a-zA-Z/$transstring$transstring/"; +} +s/porn/pr0n/g; +s/elite/l33t/g; +eval $t; + +# These are not in common usage anymore. +#s:h:|-|:ig; +#s:l:|_:ig; +#s:m:/\\/\\:ig; +#s:n:/\\/:ig; +#s:w:\\/\\/:ig; +#s:v:\\/:ig; +#s:x:><:ig; diff --git a/fanboy b/fanboy new file mode 100755 index 0000000..3881f0a --- /dev/null +++ b/fanboy @@ -0,0 +1,65 @@ +#!/usr/bin/perl + +my %topics=( + git => [qw(linus git linux rebase rebased merge merged cherry-pick + branch branched branches git-* push pull pushed pulled)], + ubuntu => [qw(Mark MOTU PPA ubuntu debian rock rocks rule dapper + feisty fiesty gutsy hoary hardy edgy + universe launchpad gnome desktop naked sabdfl community)], + debian => [qw(Debian rules rule ian murdock upstream release + stable unstable testing apt apt-get deb developer NM RM + NMU FTBFS BTS ITP DFSG non-free free d.o)], +); + +if (! @ARGV) { + @ARGV=@{$topics{git}}; +} +elsif (@ARGV == 1 && exists $topics{lc $ARGV[0]}) { + @ARGV=@{$topics{lc $ARGV[0]}}; +} + +my $total_awesomeness_dude=join("|", + map { + $_=quotemeta($_); + s/\\\*/.*/g; + s/\\\?/./g; + qr/\b$_\b/; + } reverse sort @ARGV); + +my $len=0; +my $indent=""; +my $indent_printed=0; +while () { + if (/$total_awesomeness_dude/i) { + if (/^([>|][>|\s]*)/) { + if ($indent ne $1) { + print "\n" if $len; + $len=0; + $indent=$1; + $indent_printed=0; + } + } + else { + if (length $indent && $indent_printed) { + print "\n"; + $len=0; + } + $indent=""; + $indent_printed=0; + } + + while(/(($total_awesomeness_dude)[.?!]*)/ig) { + $len+=length($1)+1; + if ($len > 70) { + print "\n"; + $len=0; + } + if (length $indent && ! $indent_printed) { + print $indent; + $indent_printed=1; + } + print $1." "; + } + } +} +print "\n" if $len; diff --git a/filters.6 b/filters.6 new file mode 100644 index 0000000..29f9bd9 --- /dev/null +++ b/filters.6 @@ -0,0 +1,105 @@ +.TH FILTERS 6 +.SH NAME +ken, b1ff, censor, chef, cockney, eleet, fanboy, fudd, jethro, jibberish, jive, kenny, kraut, ky00te, nethack, newspeak, nyc, pirate, rasterman, scottish, spammer, scramble, studly, uniencode, upside\-down \- assorted text filters +.SH SYNOPSIS + $SHELL | chef + + newspeak < thesis.tex > newthesis.tex + + eleet | wall # b1ff works well too + + b1ff | ircII | censor +.SH "DESCRIPTION" +All of these programs are filters to do all sorts of strange things to text. +No personal, racial, religious or societal slurs are intended. For amusement +only. +.P +All the filters read input from stdin, change it, and write the filtered +text to stdout. Some filters also support reading from files and +writing to stdout. +.IP b1ff +The B1FF filter +.IP lolcat +As seen in internet gifs everywhere. +.IP cockney +Cockney English +.IP chef +convert English on stdin to Mock Swedish on stdout +.IP eleet +K3wl hacker slang +.IP fanboy +Speak like a fanboy. Filters out extraneous words and focuses on the words +fans use. By default, it will speak like a fan of git/Linus/linux +development. To change this, pass as parameters the words that the fanboy +typically uses. Alternatively, pass the name of a topic that typically has +fanboys to use a predefined word list. +.IP fudd +Elmer Fudd +.IP jethro +Hillbilly text filter +.IP jive +Jive English +.IP jibberish +Runs text through a random selection of the rest of the filters, to make really +weird output. +.IP ken +English into Cockney, featuring (dubious) rhyming +slang for a lot of computer terminology. +.IP kraut +Generates text with a bad German accent. +.IP kenny +Generates text as spoken by Kenny on South Park. +.IP ky00te +This program places a very cute (and familiar to FurryMuck +fans) accent on any text file. +.IP nethackify +Wiped out text like can be found in nethack. +.IP newspeak +A-la-1984 +.IP censor +CDA-ize text +.IP nyc +Brooklyn English +.IP pirate +Talk like a pirate. +.IP rasterman +Makes text look like it came from the keyboard of Carsten Haitzler. +.IP scottish +Fake scottish (dwarven) accent filter, inspired by the character "Durkon" +from Order of the Stick. +.IP spammer +Turns honest text into something that is liable to be flagged as spam. +.IP scramble +Scramble the "inner" letters of each word in the input into a random order. +The resulting text is still strangely readable. +.IP studly +Studly caps. +.IP uniencode +Use glorious unicode to the fullest possibile extent. As seen previously in +many man pages. +.IP upside\-down +Flips text upside down. Stand on your head and squint to read the output. +.SH "SEE ALSO" +.IP /usr/share/doc/filters/SAMPLES +Lists samples of the output of all the filters. +.PP +Other filters: +.TP +.B pig +From the bsdgames package, pig converts text to pig latin. +.TP +.B dog --oog +From the dog package, dog can also function as a filter, converting text to +OOG-speak. +.SH AUTHORS +The eleet, upside\-down, chef, b1ff, and censor 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, ken is by +Stephen K Mulrine , newspeak is by Jamie Zawinski +, studly is by Nick Phillips , +Gurkan Sengun wrote nethackify, Dougal Campbell + wrote pirate, kraut is by John Sparks, scottish by +Adam Borowski, Kenny is by Christian Garbs and Alan Eldridge, +and scramble by Andrew J. Buehler. diff --git a/fudd b/fudd new file mode 100755 index 0000000..71460f2 --- /dev/null +++ b/fudd @@ -0,0 +1,14 @@ +#!/usr/bin/perl -p +# Elmer Fudd. GPL 2001 by Joey Hess +s/[rl]/w/g; +s/qu/qw/g; +s/th\b/f/g; +s/th\B/d/g; +s/n\./n, uh-hah-hah-hah. /g; +s/[RL]/W/g; +s/Qu/Qw/g; +s/QU/QW/g; +s/TH\b/F/g; +s/TH\B/D/g; +s/Th/D/g; +s/N\./N, uh-hah-hah-hah./g; diff --git a/jethro.l b/jethro.l new file mode 100644 index 0000000..408d396 --- /dev/null +++ b/jethro.l @@ -0,0 +1,265 @@ + + /* jethro.l */ +%e 7000 +%k 5000 +%p 9000 +%n 2000 +%a 9000 +%o 7000 + +SW [\n \"(] +EW [\n ".",\"!?):;] +BW [\n ] + +%{ + /* + ** jethro v. 1.00 06/10/93 + ** Duane Paulson "dap" + ** Hillbilly text filter. Compile with lex, then C. + ** syntax will be: + ** jethro output_file. + ** Public domain. Use at your own risk. Y'all come back now, heah? + */ + /************************************************************************* + REVISION LOG + when ver who change + -------- ---- --- ----------------------------------------------------- + 06/10/93 1.00 dap Initial release. + 8.May.94 1.10 beg Fixed for HP-UX + *************************************************************************/ + +#define PUTLAST unput(*(yytext+strlen(yytext)-1)); +#define SUB(A) fprintf(yyout, "%c%s", *A|(*yytext&32), A+1); +#define SSUB(A) fprintf(yyout, "%c%c%s", *yytext, *A|(*(yytext+1)&32), A+1); +#define SESUB(A) fprintf(yyout, "%c%c%s", *yytext, *A|(*(yytext+1)&32), A+1); PUTLAST; +#define ESUB(A) fprintf(yyout, "%c%s", *A|(*yytext&32), A+1); PUTLAST; + +#include + +char WhAt[]="@(#)Duane Paulson's hillbilly text filter. (jethro)\n@(#)$Header: jethro.l,v 1.1 94/05/08 23:41:58 bgriffin Final $" +; + +%} + +%% + +{SW}[Gg]reetings{EW} | +{SW}[Hh]i{EW} | +{SW}[Hh]ello{EW} SESUB("Howdy"); +{SW}[Bb]ye{EW} | +{SW}[Gg]oodbye{EW} SESUB("Y'all come back now, heah?"); +{SW}[Hh]ear{EW} SESUB("Heah"); +{SW}[Cc]ar{EW} | +{SW}[Aa]uto{EW} | +{SW}[Rr]elax{EW} SESUB("Set a spell -- put yore feet up"); +{SW}[Aa]utomobile{EW} SESUB("Gasoline buggy"); +[Ss]wimming{BW}pool SUB("Cement pond"); +[Pp]ool{BW}table SUB("Fancy eatin table"); +[Pp]ool{BW}cue | +[Cc]ue{BW}stick SUB("Fancy pot passer"); +{SW}[Bb][r]?oil{EW} | +{SW}[Bb]ake{EW} | +{SW}[Ff]ry{EW} | +{SW}[Ss]aute{EW} | +{SW}[Cc]ook{EW} SESUB("Whomp up"); +{SW}[Bb][r]?oiling{EW} | +{SW}[Bb]akeing{EW} | +{SW}[Ff]rying{EW} | +{SW}[Ss]auteing{EW} | +{SW}[Cc]ooking{EW} SESUB("Whompin up"); +{SW}[Bb][r]?oiled{EW} | +{SW}[Bb]aked{EW} | +{SW}[Ff]ryed{EW} | +{SW}[Ss]auted{EW} | +{SW}[Cc]ooked{EW} SESUB("Done whomped up"); +{SW}[Bb][r]?oils{EW} | +{SW}[Bb]akes{EW} | +{SW}[Ff]rys{EW} | +{SW}[Ss]autes{EW} | +{SW}[Cc]ooks{EW} SESUB("Whomps up"); +{SW}[Gg]roceries{EW} | +{SW}[Ff]ood{EW} SESUB("Vittles"); +[Ss]alad SUB("Slaw"); +[Vv]egetable SUB("Green"); +[Pp]otato SUB("Tater"); +{SW}[Tt]omato SSUB("Tuhmater"); +{SW}[Rr]hubarb{EW} SESUB("Pie plant"); +{SW}[Ll]iquor{EW} | +{SW}[Ww]hisk[e]?y{EW} | +{SW}[Ss]cotch{EW} | +{SW}[Bb]ourbon{EW} | +{SW}[Gg]in{EW} | +{SW}[Vv]odka{EW} | +{SW}[Tt]equila{EW} | +{SW}[Ll]iqueur{EW} SESUB("Rheumatiz medcin"); +{SW}[Bb]ooze{EW} SESUB("Corn likker"); +{SW}[Cc]ocktail{EW} | +{SW}[Mm]ixed{BW}drink{EW} SESUB("Waste of good likker"); +{SW}[Bb]ar{EW} SESUB("Dance hall"); +{SW}[Bb]ars{EW} SESUB("Dance halls"); +{SW}[Ss]aloon | +{SW}[Cc]ocktail{BW}lounge SESUB("Dance hall"); +{SW}[Ww]hore | +{SW}[Pp]rostitute | +{SW}[Ss]lut SSUB("Dance hall girl"); +{SW}[Ss]ecret{BW}agent{EW} | +{SW}[Ss]py{EW} | +{SW}007{EW} SESUB("Double nought spy"); +{SW}[Zz]ero{EW} SESUB("Nought"); +{SW}[Pp]ants{EW} SESUB("Trousers"); +{SW}[Jj]eans{EW} | +{SW}[Dd]ungarees{EW} | +{SW}[Ll]evi[']?s{EW} SESUB("Overhalls"); +{SW}[Ss]hoe SSUB("High-button shoe"); +{SW}[Jj]acket SSUB("Coat"); +{SW}[Ss]hotgun SSUB("Fowlin piece"); +{SW}[Rr]evolver | +{SW}[Gg]un SSUB("Shootin iron"); +{SW}[Rr]ifle SSUB("Ozark longrifle"); +{SW}[Ll]ibrar[yi] SSUB("Liberry"); +[Ww]ash SUB("Warsh"); +[Ff]amily SUB("Fambly"); +[Ff]ry{BW}pan | +[Ff]rying{BW}pan | +[Ss]aute{BW}pan SUB("Skillet"); +{SW}[Aa]nimal SSUB("Critter"); +{SW}FBI{EW} | +{SW}F.B.I.{EW} | +{SW}CIA{EW} | +{SW}C.I.A.{EW} | +{SW}ATF{EW} | +{SW}A.T.F.{EW} | +{SW}IRS{EW} | +{SW}I.R.S.{EW} | +{SW}SS{EW} | +{SW}S.S.{EW} | +{SW}[Ss]elective{BW}[Ss]ervice{EW} | +{SW}[Ss]elective{BW}[Ss]ervice{BW}[Ss]ystem{EW} | +{SW}[Ss]ecret{BW}[Ss]ervice{EW} SESUB("Revanooers"); +{SW}[Pp]olice | +{SW}[Pp]oliceman | +{SW}[Ss]heriff | +{SW}[Dd]eputy | +{SW}[Dd]eputy{BW}[Ss]heriff | +{SW}[Mm]arshall | +{SW}[Dd]eputy{BW}[Mm]arshall | +{SW}[Pp]ark{BW}[Rr]anger | +{SW}[Tt]exas{BW}[Rr]anger | +{SW}[Hh]ighway{BW}[Pp]atrol SSUB("Constable"); + +{SW}[Mm]other | +{SW}[Mm][ao]mm[ay]? | +{SW}[Mm]ommie | +{SW}[Mm]om SSUB("Maw"); +{SW}[Mm]a{EW} SESUB("Maw"); +{SW}[Ff]ather SSUB("Paw"); +{SW}[Dd]ad{EW} | +{SW}[Dd]addy | +{SW}[Pp]a{EW} | +{SW}[Pp][ao]p{EW} | +{SW}[Pp][ao]pp[ay]?{EW} SESUB("Paw"); +{SW}[Gg]randmother{EW} | +{SW}[Gg]randma[w]?{EW} SESUB("Granny"); +{SW}[Gg]randfather{EW} | +{SW}[Gg]ran[d]{1,2}ad[d]?[y]?{EW} | +{SW}[Gg]randpop{EW} | +{SW}[Gg]randpa[w]?{EW} SESUB("Grampy"); +{SW}[Mm]y{EW} SESUB("Mah"); +{SW}them{EW} SESUB("em"); +[Dd]og SUB("Dawg"); +[Ll]awyer | +[Ll]egal{BW}counc[ei]l | +[Ll]egal{BW}councellor | +[Aa]ttorney | +[Aa]ttorney{BW}[Aa]t{BW}[Ll]aw SUB("City slicker"); + +{SW}[Tt]han{EW} SESUB("Then"); +[Cc]haracterize SUB("Show"); +{SW}[Vv]ery{EW} | +{SW}[Ee]xtremely{EW} | +{SW}[Rr]eally{EW} | +{SW}[Rr]eal{EW} SESUB("Right"); +{SW}[Hh]aven't{EW} | +{SW}[Ii]sn't{EW} | +{SW}[Aa]ren't{EW} SESUB("Aint"); +{SW}[Ss]aid{EW} | +{SW}[Ss]ays{EW} SESUB("Sez"); +{SW}[Aa]re{EW} SESUB("Is"); +{SW}[Ss]hould{EW} SESUB("Ortta"); +{SW}[Pp]erhaps{EW} | +{SW}[Mm]aybe{EW} SESUB("Mebbe"); +{SW}[Ss]ick{EW} SESUB("Ailin'"); +{SW}I'm{BW}not{EW} SESUB("I aint"); +{SW}[Ss]cared{EW} SESUB("A-skeert"); +{SW}[Ss]care SSUB("Skeer"); +{SW}[Hh]ave{EW} SESUB("Got"); +{SW}[Pp]ossess{EW} SESUB("Have"); +{SW}[Hh]elp SSUB("Hep"); +{SW}[Tt]ired{EW} SESUB("Tuckered out"); +{SW}[Cc]ompletely{EW} SESUB("Plumb"); +{SW}[Dd]runk{EW} SESUB("A mite woozy"); + +{SW}[Yy]es{EW} SESUB("Yep"); +{SW}[Nn]o{EW} SESUB("Nope"); + +{SW}[Ii]t{BW}is{EW} SESUB("Tis"); +{SW}[Aa]t{BW}all{EW} *(yytext+1)=(char)'A'; SESUB("A tall"); + +{SW}[Aa]m{EW} | +{SW}[Ww]as{EW} | +{SW}[Ww]ere{EW} SESUB("Wuz"); +{SW}[Ww]asn't{EW} SESUB("Wasunt"); +[Ee]very SUB("Ever"); +{SW}[Ww]ant/s SSUB("Is after"); +{SW}[Ww]anted{EW} SESUB("Was after"); +{SW}[Ww]anting{EW} SESUB("Hankering after"); +{SW}[Dd]oesn't{EW} | +{SW}[Dd]on't{EW} SESUB("Dasent"); +{SW}[Yy]ou'll{EW} SESUB("Y'all will"); +{SW}[Yy]our SSUB("Yore"); +{SW}[Mm]ore{EW} SESUB("Mo"); +tial SUB("shul"); +cious SUB("shus"); +ious SUB("yus"); +tion SUB("shun"); +{SW}[Cc]an{EW} SESUB("C'n"); +{SW}[Yy]ou{EW} SESUB("Y'all"); +{SW}[Ff]or{EW} SESUB("Fer"); +{SW}[Tt]he{EW} SESUB("Duh"); +ing SUB("in"); +{SW}[Tt]oo{EW} SESUB("Besides"); +{SW}[Tt]o{EW} SESUB("Tuh"); +{SW}[Aa][n]?{EW} SESUB("Ah"); +{SW}[Oo]ur{EW} | +{SW}[Oo]r{EW} SESUB("Ore"); +{SW}[Oo]f{EW} SESUB("Uv"); +{SW}I{EW} SESUB("Ah"); +{SW}I'm{EW} SESUB("Ahm a"); +{SW}I'll{EW} SESUB("Ahl"); +{SW}I'd{EW} SESUB("Ah wood"); +'nt *(yytext)=(char)'u'; SUB("unt"); +'re SUB(" is"); +'ve SUB(" done"); +eed{EW} ECHO; +ed{EW} ESUB("d"); +{SW}[Oo]wn{EW} | +{SW}[Tt]own{EW} | +{SW}[Dd]own{EW} | +{SW}[Gg]own{EW} | +{SW}[Bb]rown{EW} ECHO; +wn{EW} ESUB("ed"); +{SW}[Bb]elow{EW} | +{SW}[Kk]now{EW} | +{SW}[Tt]hrow{EW} | +{SW}[Gg]row{EW} | +{SW}[Hh]ow{EW} | +{SW}[Nn]ow{EW} | +{SW}[Bb]row{EW} | +{SW}[Ss]how{EW} ECHO; +ow{EW} ESUB("er"); +re{EW} | +er{EW} ESUB("uh"); +{SW}[Hh]er{EW} ECHO; +! SUB(". Ye DAWGies!!!"); + +%% diff --git a/jibberish b/jibberish new file mode 100755 index 0000000..af0ea16 --- /dev/null +++ b/jibberish @@ -0,0 +1,49 @@ +#!/usr/bin/perl +# jibberish -- run filters in random order + +$ENV{PATH}.=":/usr/games"; + +@all= qw( +eleet +b1ff +chef +jethro +upside-down +kraut +cockney +jive +pirate +nyc +ken +ky00te +rasterman +newspeak +studly +censor +spammer +); + +# shuffle order +srand; +for (0..$#all) { + my $n= @all*rand; + my $was= $all[$_]; + $all[$_]= $all[$n]; + $all[$n]= $was; +} + +# start the pipe... +my $pipe= join '|', @all[0..3 + rand(5)]; +open FILTER, "$pipe|" + or die "Never mind...\n"; + +# display the results +while () { + print $_ +} + +# This could be optimized: take the last program off the pipeline, +# open the pipeline as standard input, then exec that last program. +# +# But you have to ask yourself: how important is it to optimize +# the generation of jibberish? diff --git a/jive.l b/jive.l new file mode 100644 index 0000000..1171975 --- /dev/null +++ b/jive.l @@ -0,0 +1,253 @@ +%{ +/* + * Lex filter to transform plain English into Jive English. + * No racial or societal slurs are intended. For amusement only. + * + * Copyright 1986 by Daniel Klein and Clement Cole. + * + * Reproduction permitted so long as this notice is retained. + */ + +%} +%e 1700 +%p 4000 +%n 700 +%k 450 +%a 1700 +%o 1500 +BW [ \t\(] +EW [ \t.,;!\?$\)] +%% +%{ + void plastc() + { + unput(yytext[yyleng-1]); + } +%} +@[Bb]egin(.*) | +".so ".*$ printf("%s", yytext); +{BW}send printf("%ct'row",yytext[0]); +program+ printf("honky code"); +[Uu]nix printf("slow mo-fo"); +UNIX printf("dat slow mo-fo"); +actual printf("ak'shul"); +{BW}take printf("%csnatch",yytext[0]); +{BW}took | +{BW}take[ns] printf("%csnatch'd",yytext[0]); +[Mm]exican printf("%cet-back", caseify('w')); +[Ii]talian printf("%creaser", caseify('g')); +{BW}big{EW} { printf("%cbig ass",yytext[0]);plastc();} +fool printf("honkyfool"); +modem printf("doodad"); +{BW}he{EW} { printf("%cmah' man he",yytext[0]);plastc();} +"e the"{EW} | +"a the"{EW} | +"t the"{EW} | +"d the"{EW} { printf("%c da damn", yytext[0]);plastc();} +wife | +woman printf("mama"); +girl printf("goat"); +something printf("sump'n"); +{BW}lie printf("%chonky jive",yytext[0]); +-o- printf("-on rebound-"); +[a-z]"." { printf("%s", yytext);expletive();} +! printf(". Right On!"); +[Ss]ure printf("%cho'", yytext[0]); +get printf("git"); +"will have"{EW} | +"will"{EW} | +"got to"{EW} { printf("gots'ta");plastc();} +"I am" printf("I's gots'ta be"); +"aren't" | +"am not" | +"have not" | +"is not" | +"are not" printf("ain't"); +{BW}see{EW} { printf("%csee's",yytext[0]);plastc();} +{BW}are{EW} { printf("%cis",yytext[0]);plastc();} +{BW}hat{EW} { printf("%cfedora",yytext[0]);plastc();} +{BW}shoe printf("%ckicker",yytext[0]); +{BW}"have to"{EW} | +{BW}has{EW} { printf("%cgots'ta",yytext[0]);plastc();} +have printf("gots'"); +{BW}go{EW} | +{BW}"come over"{EW} | +{BW}come{EW} { printf("%cmosey on down",yytext[0]);plastc();} +buy printf("steal"); +{BW}car{EW} { printf("%cwheels",yytext[0]);plastc();} +drive printf("roll"); +{BW}food printf("%ccatfish an' colluhd greens",yytext[0]); +{BW}eat{EW} { printf("%cfeed da bud",yytext[0]);plastc();} +drink printf("guzzle"); +black | +negro printf("brother"); +white printf("honky"); +nigger printf("gentleman"); +nice printf("supa' fine"); +{BW}person printf("%csucka'",yytext[0]); +[Pp]eople printf("%cucka's", caseify('s')); +{BW}thing thing(yytext[0]); +house{EW} { printf("crib");plastc();} +home printf("plantation"); +name printf("dojigger"); +{BW}path printf("%calley",yytext[0]); +[Cc]omputer printf("%clunker", yytext[0]); +or printf("o'"); +president printf("super-dude"); +"prime minister" printf("prahm mistah"); +government printf("guv'ment"); +knew printf("knowed"); +[Bb]ecause printf("'%cuz", caseify('c')); +[Yy]our printf("%co'", yytext[0]); +[Ff]our printf("%coe", yytext[0]); +got printf("gots"); +young printf("yung"); +you printf("ya'"); +You printf("You's"); +first printf("fust"); +police printf("honky pigs"); +{BW}string printf("%cchittlin'",yytext[0]); +{BW}read printf("%ceyeball",yytext[0]); +write printf("scribble"); +think{EW} { printf("thin'");plastc();} +with printf("wif"); +other printf("uthu'"); +[Tt]hr printf("%c'r", yytext[0]); +[Tt]h printf("%c", caseify('d')); +ing printf("in'"); +{BW}a{EW} { printf("%csome",yytext[0]);plastc();} +{BW}to{EW} { printf("%ct'",yytext[0]); + if(yytext[yyleng-1]!=' ') + plastc(); + } +tion printf("shun"); +[Aa]lmost printf("%cos'", caseify('m')); +from printf("fum"); +[Yy]"ou're" printf("%couse", yytext[0]); +alright | +okay printf("coo'"); +[Aa]nd printf("%cn'", yytext[0]); +known printf("knode"); +want printf("wants'"); +beat printf("whup'ed"); +ile printf("ah'l"); +er{EW} { printf("uh");plastc();} +[a-z]sti printf("%cs'i", yytext[0]); +tute printf("toot"); +exp printf("'sp"); +exs | +exc printf("'s"); +{BW}ex printf("%c'es",yytext[0]); +[ae]ct{EW} { printf("%cc'", yytext[0]); plastc(); } +like printf("likes"); +done | +did printf("dun did"); +"kind of" printf("kind'a"); +women printf("honky chicks"); +{BW}man{EW} { printf("%cdude",yytext[0]);plastc();} +{BW}men{EW} | +{BW}mens{EW} { printf("%cdudes",yytext[0]);plastc();} +injured printf("hosed"); +killed | +dead printf("wasted"); +good printf("baaaad"); +open{EW} { printf("jimmey");plastc();} +opened{EW} { printf("jimmey'd");plastc();} +{BW}very printf("%creal",yytext[0]); +per printf("puh'"); +oar printf("o'"); +{BW}can printf("%ckin",yytext[0]); +{BW}just{EW} { printf("%cplum",yytext[0]);plastc();} +[Dd]etroit printf("Mo-town"); +[Ww]"estern "[Ee]"lectric" printf("da' cave"); +{BW}believe printf("%crecon'",yytext[0]); +[Ii]"ndianapolis" printf("Nap-town"); +Daniel | +Dan printf("Liva' Lips"); +Reagan printf("Kingfish"); +Ronald{EW} | +Ron{EW} { printf("Rolo");plastc();} +John printf("Rastus"); +Jim printf("Bo-Jangles"); +pontiff | +pope printf("wiz'"); +[Pp]ravda printf("dat commie rag"); +broken printf("bugger'd"); +strange{EW} { printf("funky");plastc();} +dance{EW} { printf("boogy");plastc();} +ask printf("ax'"); +{BW}so{EW} { printf("%cso's",yytext[0]);plastc();} +heard printf("'hoid"); +head printf("'haid"); +boss printf("main man"); +money printf("bre'd"); +[a-z]":" { *(yytext+1) = ','; + printf("%s dig dis:",yytext); + } +amateur printf("begina'"); +radio printf("transista'"); +{BW}of{EW} { printf("%cuh",yytext[0]);plastc();} +which | +what printf("whut"); +"don't" printf("doan'"); +does printf("duz"); +{BW}was{EW} | +{BW}were{EW} { printf("%cwuz",yytext[0]);plastc();} +{BW}understand printf("%cdig",yytext[0]); +{BW}my printf("%cmah'",yytext[0]); +again | +against printf("agin'"); +{BW}[Ii]{EW} { printf("%cah'",yytext[0]);plastc();} +meta printf("meta-fuckin'"); +cally printf("c'l"); +%% + +caseify(c) +char c; +{ + if (yytext[0] <= 'Z') + return (c - ' '); + else + return (c); +} + +thing(c) +char c; +{ + static short count = 0; + + putchar(c); + switch (count++ % 4) { + case 0: case 2: + printf("thang"); + break; + case 1: + printf("doohickey"); + break; + case 3: + printf("wahtahmellun"); + break; + } +} +expletive() +{ + static short count = 0; + static short which = 0; + + if (count++ % 4 == 0) { + switch (which++ % 5) { + case 0: printf(" What it is, Mama!"); break; + case 1: printf(" Ya' know?"); break; + case 2: printf(" Sheeeiit."); break; + case 3: printf(" Ya' dig?"); break; + case 4: printf(" Git down!"); break; + } + } +} + +/* + * Bugs: + * + * If a sentence starts with a keyword it doan' get converted, or: + * it do, but gets a leading space + */ diff --git a/ken.l b/ken.l new file mode 100644 index 0000000..dc2ce76 --- /dev/null +++ b/ken.l @@ -0,0 +1,288 @@ +%{ +/* + * 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"); +W[aA][pP] printf("Pony and trap"); +" wap" 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("%s", yytext); +\n printf("\n"); +%% diff --git a/kenny b/kenny new file mode 100755 index 0000000..f9e8dce --- /dev/null +++ b/kenny @@ -0,0 +1,384 @@ +#!/usr/bin/perl -w +# +# kenny.pl -- translate from and to KennySpeak +# +# $Revision: 1.7 $ +# +# Licensed unter the Artistic License: +# http://www.perl.com/language/misc/Artistic.html +# +# (C) 2001,2002 by Christian Garbs , http://www.cgarbs.de +# Alan Eldridge +# +# KennySpeak invented by Kohan Ikin +# http://www.namesuppressed.com/kenny/ + +# +# $Id: kenny.pl,v 1.7 2002/01/06 22:09:52 mitch Exp $ +# + +use strict; + +# +# This is Perl POD documentation. +# You can generate a nice manpage with "pod2man kenny.pl > kenny.man". +# Or have a look at "perldoc perlpod" for other options +# + +=head1 NAME + +kenny.pl -- translate from and to KennySpeak + +=head1 SYNOPSIS + +B +S<[ B<-h> ]> +S<[ B<-u> ]> +S<[ B<-k> | B<-d> ]> +S<[ I ] [ I ] ...> + +=head1 OVERVIEW + +kenny.pl translates a given text from or to B. KennySpeak +looks like this: + + "Ppfmfp ppmffm mfmppfmpm, fmpmfpmppffm'fpmmpp + pmpmffpmfpmfmppmpm Pmpmppppppppffm!" + +=head1 DESCRIPTION + +kenny.pl will read the given filenames, translate them and print the +results on stdout. If you don't give a filename, stdin is used. A F<-> +as a filename means stdin. + +Without any parameters, kenny.pl will look at the first line of input +and guess which way you want to translate. If kenny.pl guesses wrong, +you must select the translation mode using the B<-k> or B<-d> switch. + +=head2 Switches + +=over 5 + +=item B<-h> + +This will print a short notice and a quick summary of the available +switches. + +=item B<-u> + +This will convert German umlauts to Ae, Oe, Ue, ae, oe, ue and ss +so that they can be kennyfied correctly. + +=item B<-k> + +Kennyfy. This forces the input to be translated into KennySpeak. + +=item B<-d> + +Dekennyfy. This forces the input to be translated back from +KennySpeak. + +=back + +=head1 VERSION + +This is $Revision: 1.7 $. + +=head1 BUGS + +The B<-u> switch might not work for charsets other than Latin-1. You +might try to convert the kenny.pl script using B to change it +from Latin-1 to your preferred charset. + +=head1 CREDITS + +kenny.pl was written by B. Look on his homepage for +newer versions of kenny.pl. Bug reports or comments about the program +should be sent to him: + Christian Garbs > + F + +KennySpeak was invented by B. See his homepage for an +online version of the original B: + Kohan Ikin > + F + +Alan Eldridge > patched in a signal handler to +print an appropriate message when kenny.pl is killed. + +=head1 COPYRIGHT + +kenny.pl is licensed unter the B which can be found +at F. This license +has been chosen for keeping compatibility with the original KennySpeak +format. + +=cut + + + +###################################################################### +# +# CHANGELOG +# +# $Log: kenny.pl,v $ +# Revision 1.7 2002/01/06 22:09:52 mitch +# Included patch by Alan Eldridge +# to show a message when kenny.pl is killed. +# +# Revision 1.6 2001/07/20 19:04:49 mitch +# Removed warnings with Perl 5.6. +# Thanks go to Alan Eldridge +# +# Revision 1.5 2001/07/15 10:27:57 mitch +# Included notice about -u and charsets other than Latin-1. +# +# Revision 1.4 2001/07/14 13:16:30 mitch +# Initial release. +# +# +# +###################################################################### + + + +# +# finally{}, the source code! +# + + + +##### Declaration of function prototypes + +sub generateKenny(); +sub generateDeKenny($); +sub guessDialect($); +sub translate($); +sub addGermanUmlauts($); +sub printHelp(); +sub theyKilledKenny(); + + + +##### Default values for various option: + +my $dialect = 0; # Translate from or to KennySpeak? + # 0=guess, 1=encode, 2=decode + +my $umlauts = 0; # Convert German Umlauts before translation? + # TRUE=ÄÖÜäöüß => Ae, Oe, Ue, ae, ou, ue, ss + + + +##### The KennySpeak translation tables: + +my $kenny = generateKenny(); # encoding table +my $dekenny = generateDeKenny($kenny); # decoding table + + + +##### Install signal handlers + +$SIG{HUP} = \&theyKilledKenny; +$SIG{INT} = \&theyKilledKenny; +$SIG{QUIT} = \&theyKilledKenny; +$SIG{TERM} = \&theyKilledKenny; + + + +##### Parse commandline arguments + +# "-h" switch (print help): + +if (grep /^-h$/, @ARGV) { + printHelp(); + exit 0; +} + +# "-u" switch (convert German umlauts): + +if ((defined $ARGV[0]) && ($ARGV[0] eq "-u")) { + $umlauts = 1; + shift @ARGV; +} elsif ((defined $ARGV[1]) && ($ARGV[1] eq "-u")) { + $umlauts = 1; + splice @ARGV, 1, 1; +} + +# "-k" and "-d" switch (force encoding/decoding): + +if (defined $ARGV[0]) { + if ($ARGV[0] eq "-k") { + $dialect = 1; + shift @ARGV; + } elsif ($ARGV[0] eq "-d") { + $dialect = 2; + shift @ARGV; + } +} + + + +##### add German umlauts to encoding if desired: + +if ($umlauts) { + addGermanUmlauts($kenny); +} + + + +##### Process the given input files (or stdin of none given) + +while (my $line=<>) { + chomp $line; + $dialect = guessDialect($line) unless $dialect; + $line = translate($line); + print "$line\n"; +} + + + +##### That's all, folks! + +exit 0; + + +##### Signal handler, if we're kill(1)ed + +sub theyKilledKenny() +{ + print "Oh my God! They killed Kenny! You bastards!\n"; + exit 0; +} + + + +##### Guess whether input is already kennyfied: + +sub guessDialect($) +{ + my $line = shift; + $line =~ tr/a-zA-Z//cd; + if (($line =~ tr/mfpMFP//c) > 0) { + return 1; + } else { + return 2; + } +} + + + +##### Encode/decode a given line + +sub translate($) +{ + my $in = shift; + my $out = ""; + if ($dialect == 1) + { + $out .= exists $kenny->{$1} ? $kenny->{$1} : $1 while ($in =~ s/^(.)//); + } else { + my @chars = split //, $in; + while (@chars) { + if ((@chars > 2) and (exists $dekenny->{$chars[0]}->{$chars[1]}->{$chars[2]})) { + $out .= $dekenny->{$chars[0]}->{$chars[1]}->{$chars[2]}; + shift @chars; + shift @chars; + shift @chars; + } else { + $out .= shift @chars; + } + } + } + return $out; +} + + + +##### Generate KennySpeak encoding table + +sub generateKenny() +{ + my %kenny; + + # lower case characters + + my ($a, $b, $c) = (0,0,0); + for my $char ("a".."z") { + my $foo = $a.$b.$c; + $foo =~ tr/012/mpf/; + $kenny{$char} = $foo; + $c++; + if ($c == 3) { + $c=0; + $b++; + if ($b == 3) { + $b=0; + $a++; + } + } + } + + # upper case characters + + map { $kenny{uc $_} = ucfirst $kenny{$_} } keys %kenny; + + return \%kenny; +} + + + +##### Generate KennySpeak decoding table + +sub generateDeKenny($) +{ + my %dekenny; + my $kenny = $_[0]; + foreach my $key (keys %{$kenny}) + { + my ($a, $b, $c) = split //, $kenny->{$key}; + if (! exists $dekenny{$a}) { + $dekenny{$a} = {}; + } + if (! exists $dekenny{$a}->{$b}) { + $dekenny{$a}->{$b} = {}; + } + $dekenny{$a}->{$b}->{$c} = $key; + } + + return \%dekenny; +} + + + +##### Add German Umlaut conversion to KennySpeak encoding table + +sub addGermanUmlauts($) +{ + my $kenny = $_[0]; + $kenny->{"ä"} = $kenny->{"a"} . $kenny->{"e"}; + $kenny->{"ö"} = $kenny->{"o"} . $kenny->{"e"}; + $kenny->{"ü"} = $kenny->{"u"} . $kenny->{"e"}; + $kenny->{"Ä"} = $kenny->{"A"} . $kenny->{"e"}; + $kenny->{"Ö"} = $kenny->{"O"} . $kenny->{"e"}; + $kenny->{"Ü"} = $kenny->{"U"} . $kenny->{"e"}; + $kenny->{"ß"} = $kenny->{"s"} x 2; +} + + + +##### Print short help message + +sub printHelp() +{ + print <<'EOF'; +kenny.pl $Revision: 1.7 $ by Christian Garbs +Use "pod2man kenny.pl > kenny.man" to generate the man page. +Usage: kenny.pl [ -h ] [ -u ] [ -k | -d ] [ file1 ] [ file2 ] ... +-h : print this help message +-u : convert German umlauts before translation +-k : force encoding to KennySpeak +-d : force decoding from KennySpeak +EOF + ; +} diff --git a/kraut.dir/destructions b/kraut.dir/destructions new file mode 100644 index 0000000..4390437 --- /dev/null +++ b/kraut.dir/destructions @@ -0,0 +1,36 @@ + Kraut + +++++++++++++++++ +Compiling Kraut: + +You should have the files: kraut.c and kraut.l and lex.yy.c + + +kraut.l must be run thru the unix 'lex' utility to produce the file lex.yy.c +Then compile kraut.c and lex.yy.c to produce kraut + + $lex kraut.l + $cc kraut.c lex.yy.c -o kraut + (You may get a list of warnings from the compiler. Ignore them.) + +Note: lex.yy.c is included in this package. You only need to use lex if you +wish to make changes to kraut. + +Using Kraut: + + Kraut uses standard input and output. + +examples: + +To translate a file called 'note' and output kraut to a file called 'knote': + + $ cat note | kraut > knote + +To translate a file called 'note' and just print it to the screen: + + $ cat note | kraut + +To have kraut wait to translate what you type at the keyboard and return it in +kraut on your screen: + + $ kraut + diff --git a/kraut.dir/kraut.c b/kraut.dir/kraut.c new file mode 100644 index 0000000..e09ba5f --- /dev/null +++ b/kraut.dir/kraut.c @@ -0,0 +1,25 @@ +#include +/* Kraut v0.9 */ +/* by */ +/* John Sparks */ +/* 5-5-1989 */ + +/* This is in the public domain. Do with it as you will. */ + +const char *yylex(void); + +int main() +{ + char *line; + + while((line = (char *) yylex())) { + printf("%s", line); + } + + return 0; +} + +int yywrap () +{ + return (1); +} diff --git a/kraut.dir/kraut.l b/kraut.dir/kraut.l new file mode 100644 index 0000000..e46acde --- /dev/null +++ b/kraut.dir/kraut.l @@ -0,0 +1,81 @@ +%e 2000 +%p 5000 +%n 1000 +%k 500 +%a 4000 +%o 2000 +BW [ ] +EW [ .,;!?] + +%{ +#define YY_DECL const char *yylex(void) + char buf[128]; + +%} + +%% +ing return("ingkt"); +" the " return(" ze "); +"The " return("Ze "); +" with " return(" mitt "); +"With " return("Mitt "); +wr return("w-r-r"); +Wr return("W-r-r"); +R return("R-r-r"); +"Yes " return("Jawohl "); +" r" return(" r-r-r"); +"Yes." return("Jawohl."); +"Yes!" return("Jawohl!"); +"YES!" return("JAWOHL!"); +" yes " return(" ja "); +" yes." return(" ja."); +" yes!" return(" yes!"); +"No " return("Nein "); +"No!" return("Nein!"); +"No?" return("Nein?"); +" no " return(" nein "); +" no." return(" nein."); +" no!" return(" nein!"); +" no?" return(" nein?"); +[Mm]"r." return("Herr"); +[Mm]"rs." return("Frau"); +Miss return("Fraulein"); +" of " return(" uff "); +"Of " return("Uff "); +my return("mein"); +My return("Mein"); +" and " return(" undt "); +"And " return("Undt "); +"One " return("Ein "); +" one" return(" ein"); +"Is " return("Ist "); +" is " return(" ist "); +"ow " return("ow "); +"w " return("w "); +sh return("sch"); +Sh return("Sch"); +ch return("ch"); +Ch return("Ch"); +" c" return(" k"); +" C" return(" K"); + +v return("f"); +V return("F"); +" w" return(" v"); +W return("V"); +th return("d"); +Th return("D"); +[Jj]ohn return("Johann"); +[Ww]illiam return("Wilhelm"); +[Bb]rad return("Wilhelm"); +[Gg]ary return("Gerhardt"); +[Jj]on return("Hansel"); + +[a-f]"!" {sprintf(buf,"%s Naturlich!",yytext);return(buf);} +[p-z]"!" {sprintf(buf,"%s Sieg Heil!",yytext);return(buf);} +. return(yytext); +\n return("\n"); + +%% + + diff --git a/ky00te.dir/README.ky00te b/ky00te.dir/README.ky00te new file mode 100644 index 0000000..7c92969 --- /dev/null +++ b/ky00te.dir/README.ky00te @@ -0,0 +1,83 @@ +This program is (c) 1994, Brent E. Edwards. Feel free to distribute the +complete program world-wide. (Please do NOT break apart this text file +from the program.) + +This program is under absolutely no warrantee of any kind. + +If you have any questions about this program, please send them to +edwardsb@cs.rpi.edu. + +This program is dedicated to Conrad Wong. + +This program is catware. If you find it useful in any way, pay for this +program by spending one hour petting one or several cats. + +[ Revised to plain GPL by author, see copyright file. -- Joey Hess ] + +=================================================== + + +Purpose: + This program places a very cute (and familiar to FurryMuck fans) + accent to any text file. It is designed for UNIX systems. + It requires cc, lex, and yacc to be in your path. + +Compiling: + To compile on a UNIX system, type 'make' + +Running: + To do a line-by-line translation of your text, type 'ky00te'. + Control-D will halt the program. + + To convert a text file and display it on the screen, type + 'ky00te < filename | more', where filename is the file to convert. + + To convert a text file and save it to a file, type + 'ky00te < filename.in > filename.out', where filename.in is the + file to convert and filename.out is the place to put it. + + You can also add an accent to the output of any program by + typing ' | ky00te'. + +Petting the cat: + Stroke with the furs, not against them. + +==================================================== + +Program version information: + +Program version 1.00: 13 December 1994 + +Program version 1.10: 15 December 1994 + Version 1.00 was a memory hog. Also, adds 'fur' and 'meow' to +list of cat-ch phrases. + +Program version 1.11: 16 December 1994 + With Tobias Kuhler's (ukjp@rz.uni-karlsruhe.de) repeated suggestion, + the program now only doubles (not triples) 'r' and no longer capitalizes + fur. He also suggested the following improvements: + at a, at the -> atta + in a, in the -> ynna + is a, is the -> yssa + on a, on the -> onna + with a, with the -> wyffa + the -> da + you -> ya + and -> 'n + with -> wyf + to -> ta + + This version also no longer uses the same 'meow'; it switches between + 'meow', 'mew', and 'mu' (weighted to the first). + + I've also added: + lot of -> lotta + is so -> yssa + when -> w'en + with -> wyf (when used to start a word) + your -> yer + not, n't -> na' + + + The README file has been reorganized, and the dedication made explicit. + diff --git a/ky00te.dir/ky00te.lex b/ky00te.dir/ky00te.lex new file mode 100644 index 0000000..63f877c --- /dev/null +++ b/ky00te.dir/ky00te.lex @@ -0,0 +1,64 @@ +%{ + +#include "y.tab.h" +extern int yylval; + +%} + +%% +i { yylval = 'y'; return(LETTER); } +I { yylval = 'Y'; return(LETTER); } +cks { yylval = 'x'; return(LETTER); } +ks { yylval = 'x'; return(LETTER); } +cute { return(CUTE); } +fluff { return(FLUFF); } +smile { return(SMILE); } +grin { return(SMILE); } +laugh { return(SMILE); } +chuckle { return(SMILE); } +pr { return(PURR); } +p[aeiou]*r { return(PURR); } +f[aeiou]+r { return(FUR); } +m[aeiou]+/[^.,s?! ] { return(MEOW); } /*UN*/ +"at a" { return(ATTA); } +"at the" { return(ATTA); } +"in a" { return(YNNA); } +"in the" { return(YNNA); } +"is a" { return(YSSA); } +"is the" { return(YSSA); } +"is so" { return(YSSA); } +"on a" { return(ONNA); } +"on the" { return(ONNA); } +"with a" { return(WYFFA); } +"with the" { return(WYFFA); } +"lot of" { return(LOTTA); } +" with " { return(WYF); } +" with" { return(WYFF); } +^"with " { return(WYF); } +^"with" { return(WYFF); } +" with"$ { return(WYF); } +" the " { return(DA); } +^"the " { return(DA); } +" the"$ { return(DA); } +" your" { return(YER); } +^your { return(YER); } +" you" { return(YA); } +^you { return(YA); } +" and " { return(AN); } +^"and " { return(AN); } +" and"$ { return(AN); } +" to " { return(TA); } +^"to " { return(TA); } +" to"$ { return(TA); } +" when " { return(WEN); } +^"when " { return(WEN); } +" when"$ { return(WEN); } +"n't" { return(NA); } /*UN*/ +" not" { return(NA); } /*UN*/ +[ \t] { return(' '); } +. { yylval = yytext[0]; return(LETTER); } +%% + + + + diff --git a/ky00te.dir/ky00te.yacc b/ky00te.dir/ky00te.yacc new file mode 100644 index 0000000..4254394 --- /dev/null +++ b/ky00te.dir/ky00te.yacc @@ -0,0 +1,133 @@ +%{ + +#include +typedef int INT; + +#define YYSTYPE INT + +%} + +%token CUTE +%token FLUFF +%token SMILE +%token PURR +%token FUR +%token MEOW +%token ATTA +%token YNNA +%token YSSA +%token ONNA +%token WYFFA +%token LOTTA +%token WYF +%token WYFF +%token DA +%token YER +%token YA +%token AN +%token TA +%token WEN +%token NA /*UN*/ +%token LETTER + +%% + +s: + | s t + | s ' ' + { + if (rand() % 30 < 1) + { + int inRand; + + inRand = rand() % 5; + + switch(inRand) + { + case 0: + printf(" *truffle break!* "); + break; + + case 1: + printf(" *catnap break!* "); + break; + + case 2: + printf(" *purrpurr* "); + break; + + case 3: + printf(" *meow!* "); + break; + + case 4: + printf(" *fluff!* "); + break; + } + } + else + { + printf(" "); + } + } + ; + +t: CUTE { printf("ky00te!"); } + | FLUFF { printf("*fluff!*"); } + | SMILE { printf("};)"); } + | PURR { printf("purr"); } + | FUR { printf("fur"); } + | MEOW { int inRand; + + inRand = rand() % 5; + + switch(inRand) + { + case 0: + case 1: + case 2: + printf("meow"); + break; + case 3: + case 4: + printf("mew"); + } + } + | ATTA { printf("atta"); } + | YNNA { printf("ynna"); } + | YSSA { printf("yssa"); } + | ONNA { printf("onna"); } + | WYFFA { printf("wyffa"); } + | LOTTA { printf("lotta"); } + | WYF { printf(" wyf "); } + | WYFF { printf(" wyff"); } + | DA { printf(" da "); } + | YER { printf(" yer"); } + | YA { printf(" ya"); } + | AN { printf(" 'n "); } + | TA { printf(" ta "); } + | WEN { printf(" w'en "); } + | NA { printf(" na'"); } /*UN*/ + | LETTER { if (yylval == 'r') + printf("rr"); + else + printf("%c", $1); } + ; + + +%% + +extern char mylval; + +int yyerror(char *s) { + printf("%s\n",s); +} + +int main() +{ + yyparse(); + + return 0; +} + + diff --git a/ky00te.dir/makefile b/ky00te.dir/makefile new file mode 100644 index 0000000..47d1f64 --- /dev/null +++ b/ky00te.dir/makefile @@ -0,0 +1,21 @@ +all: ../ky00te + +clean: + rm -f y.tab.* lex.yy.* + rm -f ../ky00te + +../ky00te: y.tab.o lex.yy.o + $(CC) -o ../ky00te lex.yy.o y.tab.o $(CFLAGS) + +lex.yy.o: lex.yy.c y.tab.h + $(CC) $(CFLAGS) -c lex.yy.c + +y.tab.o: y.tab.c + $(CC) $(CFLAGS) -c y.tab.c + +lex.yy.c: ky00te.lex + flex ky00te.lex + +y.tab.c: ky00te.yacc + yacc -d ky00te.yacc + diff --git a/lolcat b/lolcat new file mode 100755 index 0000000..22c4a58 --- /dev/null +++ b/lolcat @@ -0,0 +1,86 @@ +#!/usr/bin/perl -p +# lolcatz filtur +# Copyright 2013 by Joey Hess under the terms of the GNU GPL. + +# an array, not a hash. because order is important +@trans_table=( + 'can i' => 'i can', + '\bi\'ve' => 'i', + '\ba\s+' => '', # nuke 'a' + 'cheese' => 'cheez', + '\brock\b' => 'rawk', + 'ese\b' => 'ees', + 's\'s\b' => 's', + '\'s\b' => 's', + 'er\b' => 'r', + 'ture\b' => 'chur', + 'day' => 'dai', + '\bok\b' => 'k', + '\boks\b' => 'ks', + 'boy' => 'boi', + 'tion' => 'shun', + 'ight' => 'ite', + 'innocent' => 'innozent', + 'ph' => 'f', + 'es' => 'ez', + 'ed\b' => 'd', + 'ns' => 'nz', + 'ks' => 'kz', + 'ds' => 'dz', + 'se' => 'ze', + 'zs' => 's', + 'sz' => 'z', + 'ss' => 's', + 'cc' => 'cs', + 'ck' => 'k', + 'oa' => 'o', + '\bcat' => 'kat', + 'ive\b' => 'iv', + 'ake' => 'aek', + 'ed\b' => 'd', + 'ing\b' => 'in', + 'sion' => 'shun', + '\bam\b' => 'iz', + '\bhave\b' => 'has', + '\bwho' => 'hoo', + '\bwake\b' => 'waek', + '\bone\b' => '1', + '\btwo\b' => '2', + '\bto\b' => '2', + '\btoo\b' => '2', + '\bthree\b' => '3', + '\bfour\b' => '4', + '\bfor\b' => '4', + '\bfore\b' => '4', + '\bfive\b' => '5', + '\bsix\b' => '6', + '\bseven\b' => '7', + '\beight\b' => '8', + '\bnine\b' => '9', + '\bten\b' => '10', + 'god' => 'ceilin cat', + 'jezus' => 'jebus', + 'kitty' => 'kitteh', + 'saturdai' => 'katurdai', + 'allah' => 'invisible man', + 'delicious' => 'delishus', + '\bdoctor\b' => 'docta', + '\bdr\b' => 'docta', + '\bgay\b' => 'ghey', + '\bgood\b' => 'gud', + '\bever' => 'evr', + '\bpage\b' => 'paeg', + 'cheezburgr' => 'cheezburger', # fix up to canonical form +); + +y/A-Z/a-z/; + +while (@trans_table) { + $key=shift @trans_table; + $value=shift @trans_table; + s/$key/$value/g; +} + +s/es/ez/g; + +y/a-z/A-Z/; diff --git a/makesample.sh b/makesample.sh new file mode 100644 index 0000000..e7e5e16 --- /dev/null +++ b/makesample.sh @@ -0,0 +1,11 @@ +#!/bin/sh -e +chmod +x $1 +echo $1 >>SAMPLES +echo "-------------" >>SAMPLES +if [ "$1" != fanboy ]; then + printf "Here's how this filter sounds, in everyday use.\nNow is the time for all good men to come to the aid of their country." | ./$1 >>SAMPLES +else + printf "This filter has to be tried on real world text to be understood! Oh, and Ubuntu Rules!" >>SAMPLES +fi +echo "" >>SAMPLES +echo "" >>SAMPLES diff --git a/nethackify.dir/makefile b/nethackify.dir/makefile new file mode 100644 index 0000000..8c2fd9e --- /dev/null +++ b/nethackify.dir/makefile @@ -0,0 +1,16 @@ +../nethackify: + gcc nethackify.c -o ../nethackify + +test: + @../nethackify The kitten bites.--More-- + @../nethackify You begin praying to Odin. You finish your prayer.--More-- + @../nethackify A black glow surrounds you. + +clean: + rm -f ../nethackify + +install: + cp ../nethackify /usr/bin + +uninstall: + rm /usr/bin/nethackify diff --git a/nethackify.dir/nethackify.c b/nethackify.dir/nethackify.c new file mode 100644 index 0000000..1f6cb6c --- /dev/null +++ b/nethackify.dir/nethackify.c @@ -0,0 +1,87 @@ + +/* +nethackify +tries to write text ala nethack + +cat /etc/motd/ | nethackify +/exec -o nethackify "good morning :)" + +gurkan@linuks.mine.nu +*/ + +#include +#include +#include +#include + +char *normal ="ABCDEFGHIKLMNOPQRTUVWZbdeghjklmnoqwy:;01678"; +char *nethack1="^P(|||C||||||CFCP|J/V/|cccni||nrccvv.,C|o/3"; +char *nethack2="?b?)F-(-?<_??(?(F???/??|??????r???????(???o"; +char *nethack3=" [ [L \\ "; +char *nethack4=" [ \\ "; +char *nethack5=" _ \\ "; + +int myrandom(float max) +{ + return ((int)(max*rand()/(RAND_MAX+1.0))); +} + +void nethackify(char* str) +{ + int i,c; + for(i=0; i0) { + switch(myrandom(5)) { + case 4: if(nethack5[c]!=' ') str[i]=nethack5[c]; + case 3: if(nethack4[c]!=' ') str[i]=nethack4[c]; + case 2: if(nethack3[c]!=' ') str[i]=nethack3[c]; break; + case 1: if(nethack2[c]!=' ') str[i]=nethack2[c]; break; + case 0: str[i]=nethack1[c]; break; + default: break; + } + } + } + } + printf("%c",str[i]); + } + + printf(" "); +} + +int main(int argc, char **argv) +{ + int i,c; + struct timeval tv; + FILE *f; + char ch[1]; + + srand((gettimeofday(&tv,NULL),tv.tv_usec)); + if (argc==1) { + f=stdin; + while(fread(ch,1,1,f)) { + for(c=0; c diff --git a/newspeak.l b/newspeak.l new file mode 100644 index 0000000..ce0f573 --- /dev/null +++ b/newspeak.l @@ -0,0 +1,685 @@ +%{ -*- Mode:Fundamental -*- +/* + * newspeak.l, version 1.1. + * Lex filter to transform plain English into NewSpeak. + * Copyright (c) 1991 Jamie Zawinski . + * + * Permission to use, copy, modify, distribute, and sell this + * software and its documentation for any purpose is hereby granted + * without fee, provided that the above copyright notice appear in + * all copies and that both that copyright notice and this + * permission notice appear in supporting documentation. No + * representations are made about the suitability of this software + * for any purpose. It is provided "as is" without express or + * implied warranty. + * + * To compile: + * + * flex newspeak.l + * cc -O -o newspeak lex.yy.c + * rm lex.yy.c + * + * This must be compiled with "flex", not normal "lex". Lex has + * some builtin, unchangable limits which this program exceeds. + * This has been verified to work with flex version 2.3.7, and + * may not work with flex version 2.3.6. + * + * You can get 'flex' by anonymous FTP to prep.ai.mit.edu, or + * anywhere else you get GNU software. + * + * Run this like so: "newspeak < some-text-file | more" + * + * There are some design notes near the end. Suggestions and + * improvements to this code are more than welcome. + * Hail Big Brother! + *--------------------------------------------------------------------------- + */ +#include + +unsigned int fcounter = 0; + +#define Y0 yytext[0] +#define Y1 yytext[1] +#define Y2 yytext[2] +#define Y3 yytext[3] +#define C caseify +#define C1 caseify1 + +#define CAP(string) capstring(0, (string),0) +#define WCAP(string) capstring(Y0,(string),1) + +#define COMP(string1,string2) compstring(0, (string1),(string2),0) +#define WCOMP(string1,string2) compstring(Y0,(string1),(string2),1) + +#define DUMP() printf("%s",yytext) +%} + +%e 8000 +%p 9000 +%n 2000 +%k 3000 +%a 5000 +%o 4000 + +W (([ ]?\n[ ]*)|[ ]|[\"'`]) +ES [.,;:!?/] +EW ({W}|{ES}|"'") + +YOUNG (([Yy]oung|[Ss]mall|[Ll]ittle){W}) +DEAD (([Dd]ead|[Dd]eceased){W}) +THE ([Tt]he{W}?) +ANDOR ({W}(([Aa]nd)|([Oo]r)){W}?) +COLOR (red|green|blue|yellow|cyan|magenta|purple|orange|mauve|pink|turquoise|brown|gr[ae]y) + +%% + +%{ + /****************************** + * PLUSwords * + ******************************/ +%} + +[Qq]uite{EW}/[A-Za-z][A-Za-z] CAP("plus"); +[Rr]ather{EW}/[A-Za-z][A-Za-z][A-Za-z] CAP("plus"); +[Kk]ind{EW}of{EW}/[A-Za-z][A-Za-z][A-Za-z] CAP("plus"); +[Kk]inda{EW}/[A-Za-z][A-Za-z][A-Za-z] CAP("plus"); +[Mm]ore{W}than{W}a{W}(little|bit){W} CAP("plus"); +[Pp]ro- CAP("plus"); + +[Hh]undreds{W}of{W}[Tt]housands | +[Hh]undreds{ANDOR}[Tt]housands | +[Hh]undreds{W}if{W}not{W}[Tt]housands | +[Tt]housands | +[Mm]illions CAP("doubleplusmany"); + +[Dd]ozens CAP("many"); +[Hh]undreds CAP("plusmany"); + +([Bb]right|[Ll]ight|[Ii]ntense){W}/{COLOR} CAP("plus"); +([Dd]im|[Ff]aded|[Dd]ark|[Pp]ale){W}/{COLOR} CAP("plusun"); +([Dd]im|[Ff]aded|[Dd]ark|[Pp]ale) CAP("unlight"); + +[Ee]very DUMP(); +[Vv]ery{W} | +[Rr]eally{W} | +[Tt]erribly{W} | +[Aa]wesome({W})? | +[Aa]wfully{W} CAP("doubleplus"); + +[Ww]hopping{EW} CAP("plusbig"); + +"O.K." | +[Aa]ll({W})?[Rr]ight | +[Oo][Kk][Aa][Yy] CAP("plusgood"); +{W}OK/{W} WCAP("plusgood"); + +([Tt]oo|[Oo]verly|[Tt]hat){W}[Mm]uch CAP("plusmuch"); + +{W}[Bb]ad/{EW} WCAP("ungood"); +{W}[Pp]oor/{EW} WCAP("ungood"); +{W}[Ll]ame/{EW} WCAP("ungood"); +{W}[Pp]itiful/{EW} WCAP("ungood"); +{W}[Nn]asty/{EW} WCAP("plusungood"); +{W}[Hh]orrid/{EW} WCAP("doubleplus ungood"); +{W}[Hh]orrible/{EW} WCAP("doubleplus ungood"); +{W}[Aa]wful/{W} WCAP("doubleplus ungood"); +{W}[Ee]vil/{W} WCAP("doubleplus ungood"); + +%{ + /****************************** + * Titles * + ******************************/ +%} + +{W}[Ss]ir/{EW} WCAP("citizen"); +{W}[Mm]r"."/{EW} WCAP("brother"); +[Mm]ister/{EW} CAP("brother"); +[Mm]adame? CAP("sister"); +{W}[Mm]iss/{EW} WCAP("sister"); +[Mm]a"'"?am/{EW} CAP("sister"); +{W}[Mm]r?s"."/{EW} WCAP("sister"); +Mrs/{EW} CAP("sister"); + +{YOUNG}?[Cc]hildren CAP("young citizens"); +{YOUNG}?[Bb]oys{ANDOR}[Gg]irl/s CAP("young citizens"); +{YOUNG}?([Kk]id|[Gg]irl|[Bb]oy|[Cc]hild)/{EW} CAP("young citizen"); + +[Ff]ellow CAP("citizen"); + +[Nn]on{W}?"-"?citizen CAP("unperson"); +[Nn]on{W}?"-"?member CAP("unperson"); +[Cc]riminal/s? CAP("unperson"); +{DEAD}(man|woman) CAP("unperson"); +{DEAD}(men|women) CAP("unpersons"); + +[Ii]n{W}[Pp]erson DUMP(); + +{W}[Uu]ser WCOMP("party ","worker"); +[Ss]tudent COMP("party ","worker"); +[Cc]itizen/s?{EW} COMP("party ","worker"); +[Pp]erson/s?{EW} COMP("party ","worker"); +[Pp]eople COMP("party ","workers"); + +[Ss]enator | +[Cc]ongressman | +[Ss]upervisor | +[Pp]rofessor printf("Inner Party Member"); +[Pp]rof"."/{EW} printf("Inner Party Member"); +[Pp]rof/{EW} printf("Inner Party Member"); + +Representative/s? printf("Inner Party Member"); +representatives printf("Inner Party Members"); + +[Ww]hite{W}[Cc]ollar | +[Uu]pper{W}[Cc]lass COMP("inner ","party"); +[Mm]iddle{W}[Cc]lass CAP("party"); +[Bb]lue{W}[Cc]ollar | +[Ww]orking{W}[Cc]lass | +[Ll]ower{W}[Cc]lass CAP("prole"); +([Ff]ool|[Ii]diot)/s?{EW} CAP("prole"); +[Ss]tupidity CAP("proleness"); + +%{ + /****************************** + * Organizations * + ******************************/ +%} + +[Aa]?{W}([Ww]hite{W}[Hh]ouse|[Gg]ovt\.?|[Gg]overnment){W}([Ss]ource|[Oo]fficial|[Ss]pokes(man|woman|person)) CAP("an Inner Party Member"); +{THE}?[Rr]epublican{W}[Pp]arty COMP("mini","luv"); +{THE}?[Dd]emocratic{W}[Pp]arty COMP("mini","plenty"); + +{THE}?Congress printf("MiniPax"); +{THE}?[Ss]enate printf("MiniPax"); +{THE}?[Hh]ouse{W}[Oo]f{W}[Rr]epresentatives printf("MiniPax"); +{THE}?[Ss]tate{W}[Dd]epartment printf("MiniPax"); +{THE}?[Ss]tate{W}[Dd]ept"."? printf("MiniPax"); +{THE}?[Dd]efen[cs]e{W}[Dd]epartment | +{THE}?[Dd]efen[cs]e{W}[Dd]ept"."? | +{THE}?[Ww]ar{W}[Dd]epartment | +{THE}?[Ww]ar{W}[Dd]ept"."? | +{THE}?[Hh]ouse{W}of{W}[Cc]ommons | +{THE}?Pentagon | +{THE}?[Ff]eds | +{THE}?FCC | +{THE}?D[Oo]D | +{THE}"D."[Oo]".D." | +{THE}?[Ss]ecret{W}[Ss]ervice COMP("mini","luv"); +{THE}?White{W}House | +{THE}?Kremlin printf("MiniTrue"); +{THE}?(CIA|NSA|FBI|MI"-"?5)/{EW} printf("MiniTrue"); +{THE}?("C.I.A."|"N.S.A."|"F.B.I.")/{EW} printf("MiniTrue"); +{THE}?[Aa]rchive/s? COMP("mini","rec"); +{THE}?[Ll]ibrary COMP("mini","rec"); +{THE}?[Ll]ibraries COMP("mini","recs"); + +[Tt]hought{W}[Pp]olice|[Nn]azis? COMP("think","pol"); +[Vv]ice{W}[Ss]quad COMP("sex","pol"); +PMRC|"P.M.R.C." COMP("sex","pol"); + +[Oo]fficer CAP("minister"); + +{THE}?[Dd]epartment{EW}of{EW}. | +{THE}?[Dd]ept"."?{EW}of{EW}. | +{THE}?[Uu]niversity{EW}of{EW}. | +{THE}?[Uu]niv"."?{EW}of{EW}. | +{THE}?[Dd]ept"."?{EW}of{EW}. | +{THE}?([Ss]ub"-"?)?[Cc]omm?itt?ee{EW}(of|on){EW}. | +{THE}?[Ss]chool{EW}of{EW}. { + if ((yytext[yyleng-1] >= 'A') && (yytext[yyleng-1] <= 'Z')) + /* "the school of Law" --> "MiniLaw" */ + printf("Mini%c",yytext[yyleng-1]); + else if ((yytext[yyleng-1] >= 'a') && (yytext[yyleng-1] <= 'z')) + /* "the school of law" --> "MiniLaw" (not "Minilaw") */ + printf("Mini%c",yytext[yyleng-1] - ('a' - 'A')); + /* "the school of 5 things" --> "Ministry of 5 things" */ + else printf("Ministry of %c",yytext[yyleng-1]); + } + +[Dd]epartment | +[Uu]niversity CAP("ministry"); +[Uu]niv"."?/{W} CAP("ministry"); +[Dd]ept"."?/{W} CAP("ministry"); +([Ss]ub"-"?)?[Cc]omm?itt?ee CAP("ministry"); + +{THE}[Pp]roject/{EW} CAP("the Three Year Plan"); +[Oo]ur{W}[Pp]roject/{EW} CAP("our Three Year Plan"); +[Bb]udget printf("Three Year Plan"); +[Pp]roject/{ES} printf("Three Year Plan"); + +{W}({THE}|([aa]{W}))[Pp]roject printf("%cthe Three Year Plan",Y0); + +[A-Za-z]+"'"[Ss]/{W}(law|Law|LAW|book|Book|BOOK|rule|Rule|RULE){EW} printf("Goldstein's"); + +%{ + /****************************** + * Actions * + ******************************/ +%} + +[Ii]n{W}love{EW} CAP("SexCriming"); +[Ll]ove{W}you/{EW} CAP("love Big Brother"); +[Ll]ove{W}me/{EW} CAP("love Big Brother"); + +[Cc]loning | +[Rr]eproduction | +[Cc]elibacy | +[Pp]rocreation COMP("good","sex"); + +[Cc]elibate | +[Pp]rocreate COMP("good","sexwise"); + +[Tt]elevisions? | +TVs? | +[Tt]"."[Vv]"."s? | +[Rr]adios? | +[Nn]ews{W}?[Pp]apers? | +[Jj]ournalism | +[Mm]ovies? | +[Rr]ock{EW}?"-"?(and|"&"|"'"?n"'"?){EW}?"-"?[Rr]oll({W}[Mm]usic)? | +(([Rr]ock|[Cc]lassical|[Ii]ndustrial|[Pp]op|[Dd]ance|[Rr]ap){W})?[Mm]usic | +[Tt]unes | +[Mm]oney | +[Cc]ash | +[Cc]omic{W}[Bb]ooks? | +([Ss]tar{W}?)?[Tt]rek COMP("prole","feed"); + +[Pp]eace{W}[Mm]ovement | +[Pp]eace{W}[Pp]rotest | +[Aa]nti{EW}[Ww]ar | +([Pp]assive{W})?[Rr]esistance | +[Cc]reativity | +[Tt]reason | +[Rr]esearch COMP("crime","think"); +%{ + /****************************** + * Religion * + ******************************/ +%} + +[Jj]esus{W}[Cc]hrist | +[Jj]esus | +{THE}?[Bb]uddh?a | +[Mm]ohamm?ed | +[Mm]artin{W}[Ll]uther{W}[Kk]ing | +J\.?\ ?R\.?\ \"?Bob\"?\ Dobbs printf("doubleplus crimethinker"); + +([Jj]esse{W})?[Hh]elms | +([RrDd]on(ald)?{W})?[Rr]ea?gan | +[Gg]eorge{W}[Gg]uscoria printf("doubleplus goodthinker"); + +[Jj]ewish COMP("crime","thinkwise"); +[Jj]ew | +[Cc]hristian | +[Mm]oslem | +[Bb]uddhist | +[Aa]thiest | +[Aa]gnostic COMP("crime","thinker"); + +[Ff]aith COMP("belly","feel"); + +%{ + /****************************** + * Places * + ******************************/ +%} + +[Ee]ngland|{THE}?[Uu]nited{W}[Kk]ingdom | +({THE}?[Uu]nited{W}[Ss]tates{W}[Oo]f{W})?[Aa]merica | +{THE}?[Uu]nited{W}[Ss]tates|USA|"U.S.A."|[Cc]anada | +[Gg]ermany|[Ii]srael|[Ee]urope printf("Oceana"); + +Iranian|Iraqu?i|Libyan|Russian|African|Egyptian printf("Eurasian"); +Iran|Iraq|Libya|Russia|Africa|Egypt | +([Ss]audi{W})?Arabia|{THE}?Soviet{W}Union printf("Eurasia"); +[Ss]oviet printf("Eurasian"); + +[Cc]hinese|[Jj]apanese|[Tt]aiwanese | +[Pp]hillipino|[Ii]ndian|[Aa]ustralian|[Mm]exican | +[Nn]icaraguan|[Ss]alvadori?an printf("Eastasian"); +China|[Jj]apan|[Tt]aiwan|{THE}?[Pp]hillipines|[Ii]ndia | +[Aa]ustralia|[Mm]exico|[Nn]icaragua|[Ee]l{W}[Ss]alvador printf("Eastasia"); + +[Kk]uwaiti printf("Eurasian"); +[Kk]uwait printf("The Malabar Front"); + +%{ + /****************************** + * Miscelaneous Translations * + ******************************/ +%} + +{W}[Ff]aster WCAP("plus speedful"); +{W}[Ss]lower WCAP("plus unspeedful"); +{W}[Ff]ast WCAP("speedful"); +{W}[Ss]low WCAP("unspeedful"); + +[Mm]odern CAP("plusnew"); +[Aa]ncient CAP("plusunnew"); +{W}old/{W} WCAP("plusunnew"); + +[Hh]appiness CAP("joyfulness"); +[Hh]appy CAP("joyful"); +[Qq]uick CAP("speedful"); +{W}[Ss]peedy WCAP("speedful"); +[Hh]eavy CAP("weightful"); +[Hh]eavill?y CAP("weightfully"); +[Ss]ick(ly)? CAP("unhealthful"); + +[Gg]ross | +[Ss]ickening | +[Ff]oul | +[Pp]utrid | +[Dd]isgusting COMP("crime","thinkful"); + +[Ss]mash | +[Cc]rush | +[Oo]bliterate | +[Aa]nnihilate | +[Nn]eutralize | +[Dd]emolish | +[Dd]estroy CAP("unbuild"); + +[Ii]nanimate CAP("unlifeful"); +[Ss]ociety|[Cc]ulture printf("IngSoc"); +[A-Za-z]+isi?m/{EW} printf("Goldsteinism"); +[A-Za-z]+ist/{EW} printf("Goldsteinist"); + +{W}[Dd]ead WCAP("unlifeful"); +{W}[Dd]eath WCAP("unlife"); +{W}[Ll]ie WCAP("untruth"); +{W}[Ff]alsehood WCAP("untruth"); +{W}[Mm]istake/{EW} WCAP("untruth"); +{W}[Ww]hisper WCAP("unshout"); +{W}[Pp]roud WCAP("prideful"); + +[Ff]alse CAP("untrue"); +[Dd]ark CAP("unlight"); +[Bb]lack CAP("unwhite"); +[Ff]orbidden CAP("unallowed"); +[Ff]orbid CAP("unallow"); +[Ff]ailure CAP("unsuccess"); +[Ff]ail/{EW} CAP("unwin"); + +[Ss]tatistics?/{EW} CAP("propaganda"); +{W}[Aa]n{W}[Aa]nn?ouncement WCAP("a NewsFlash"); +[Aa]nn?ouncement printf("NewsFlash"); +[Ii]nstructions? printf("B. B. DayOrder"); + +[Aa]lmost|[Nn]early CAP("within measurable distance of"); +[Ff]unny CAP("humorful"); + +[Dd]oom CAP("unsave"); +[Cc]haos CAP("unorder"); +[Cc]haotic CAP("unorderful"); +[Ee]nslaved CAP("protected"); +[Ee]nslave CAP("protect"); +[Dd]angerous CAP("unsafewise"); +[Dd]anger CAP("unsafe"); +([Bb]lind{W})?[Oo]bedience COMP("ing","soc"); +\"?[Nn]ew{W}[Ww]orld{W}[Oo]rder\"? printf("IngSoc"); + +[Pp]rivacy | +[Ii]ndividuality COMP("own","life"); + +IMHO printf("for the love of Big Brother"); + +[Ee]motion(al|s)? | +[Cc]onviction | +[Bb]elie(f|ve) | +[Aa]ccept(ance)? COMP("belly","feel"); + +[Dd]emocracy | +[Ll]iberty | +[Ff]reedom | +[Jj]ustice | +{THE}?[Aa]merican{W}[Ww]ay | +[Ss]ubversion | +[Pp]assion COMP("crime","think"); + +[Oo]bscenity | +[Pp]ornography | +[Oo]rgasm | +[Ee]rotica COMP("sex","crime"); +[Ss]exy | +[Oo]bscene | +[Pp]ornographic | +[Ee]rotic COMP("sex","crimeful"); + +[Cc]ritic/s?{W} COMP("crime","thinker"); + +[Ii]nfant{W}[Mm]ortality COMP("inf","mort"); + +[Ff]amilies | +[Pp]arents COMP("family ","units"); +[Mm]other{ANDOR}[Ff]ather | +[Bb]rother{ANDOR}[Ss]ister COMP("family ","unit"); +{W}[Pp]arent/s?{EW} WCOMP("family ","unit"); +[Ff]amily COMP("family ","unit"); + +God/{EW} printf("Big Brother"); +[Pp]res(ident|".")({W}([Bb]ush|[Rr]eagan))? printf("Big Brother"); +[Pp]rime{W}[Mm]inister printf("Big Brother"); + +([Gg][Nn][Uu]{W}([Ee]macs|EMACS){W})?[Gg]eneral{W}[Pp]ublic{W}[Ll]icense printf("NewSpeak Dictionary"); + +(questioning|murder|ass?ass?ination)/{ES} printf("interrogation"); + +[Ss]keptic/{EW} CAP("unperson"); +[Ss]illy CAP("foolhardy"); +{W}[A-Za-z][A-Za-z]?illy DUMP(); +[Ss]outhern|[Ss]outherly CAP("southwise"); +[Nn]orthern|[Nn]ortherly CAP("northwise"); +[Ee]astern|[Ee]easterly CAP("eastwise"); +[Ww]estern|[Ww]esterly CAP("westwise"); +[Pl]leasant CAP("goodwise"); +[Vv]iolent CAP("unpeacewise"); +[Vv]iolence CAP("unpeaceness"); +[Ii]ndifference CAP("uncarefulness"); +[Ii]ndifferent CAP("uncareful"); +[Bb]elly CAP("abdomen"); +[Cc]omic CAP("humorwise"); +{W}[Uu]nless WCAP("lest"); +usually printf("usualwise"); + +[Gg]uerillas COMP("party ","workers"); + +[Ww]ar/{EW} CAP("engagement"); +[Dd]efen[cs]e/{EW} CAP("peace"); +[Ii]nvasion CAP("liberation"); + +%{ + /****************************** + * Syllable Rewriting * + ****************************** + isn't ___ is un___ + not the ___ the un___ + not my ___ my un___ + anti___ un___ (etc...) + ___cally ___wise + ___ally ___wise + ___lly ___wise + ___ly ___wise + ___aic ___wise + ___lic ___wise + ___nnic ___wise + tric ___wise + ___ic ___wise + ous ___ful + ous ___eful + ___less un___ful + + */ +%} + +[Ii]sn"'"t{W}my{W} CAP("is my un"); +[Ii]s{W}not{W}my{W} CAP("is my un"); +[Ii]sn"'"t{W}[Tt]he{W} CAP("is the un"); +[Ii]s{W}not{W}[Tt]he{W} CAP("is the un"); +[Ii]sn"'"t{W}[Ii]n{W}[Tt]he{W} CAP("is in the un"); +[Ii]s{W}not{W}[Ii]n{W}[Tt]he{W} CAP("is in the un"); +[Ii]t"'"?s{W}not{W}[Tt]he{W} CAP("it's the un"); +[Ii]sn"'"t{W} CAP("is un"); +[Ii]s{W}not{W} CAP("is un"); +[Nn]ot{W}[Tt]he{W} CAP("the un"); +[Nn]ot{W}[Mm]y{W} CAP("my un"); +[Nn]ot{W}[Aa]{W} CAP("an un"); +[Nn]ot{W}have{W} CAP("has un"); +[Nn]ot{W}be{W} CAP("be un"); +[Nn]ot{W}[Oo]nly/{W} CAP("unonly"); /* avoid "unonwise" */ + +[Aa]{W}[Nn]ot{W} | +[Aa]{W}[Nn]on"-"? printf("%cn%cun",Y0,Y1); /* "a non_" -> "an un_" */ + +%{ +/* {W}[Nn]ot{W} | */ +%} +{W}[Ii]l"-"?/[a-z][a-z] WCAP("un"); +{W}[Aa]nti"-"? | +{W}[Nn]on"-"? WCAP("un"); + +robably|ventually|[Oo]bvious|[Bb]asic|{W}[Oo]nly|otally | +[Aa]rctic|holic|{EW}ally|{EW}[Aa]pply|{W}[Tt]opic DUMP(); + +{W}([Tt]raf|[Pp]aci|[Ss]peci)fi/c{W} DUMP(); +{W}(ma|tra)gi/c{W} DUMP(); +{W}(pub|cyc|re|fro|gar)li/c{W} DUMP(); +{W}(eth|cli|to)ni/c{W} DUMP(); +{W}(E|cle|met|cit)ri/c{W} DUMP(); +{W}(ch|ep|tr?op|t|mus|stat|att)i/c{W} DUMP(); +{W}only/{W} DUMP(); +{W}[Aa]tlantic DUMP(); + +[ \t\n][drstwDRSTW]ally printf("%c%cally", Y0, Y1); + +[a-z]ically/{W} printf("%cwise", Y0); +[a-z]ally/{W} printf("%cwise", Y0); +[a-z][a-z]lly/{W} printf("%c%cwise", Y0,Y1); +[a-z][a-z][a-z]ly/{W} printf("%c%c%cwise", Y0,Y1,Y2); +[a-z]ical/{W} printf("%cwise", Y0); + +[a-km-qs-z]aic/{EW} printf("%cwise", Y0); /* not laic, raic */ +[a-z]lic/{EW} printf("%clwise", Y0); +[a-z]nnic/{EW} printf("%cnwise", Y0); +[a-z][aeiou]tric/{EW} printf("%c%ctwise", Y0, Y1); +[a-z]tric/{EW} printf("%cwise", Y0); +[a-z]ic/{EW} printf("%cwise", Y0); +[a-z]lly/{EW} printf("%cwise", Y0); +[a-z]ly/{EW} printf("%cwise", Y0); + +[aeiouy][^aeiouy]ous/{EW} printf("%c%cful",Y0,Y1); +[^aeiouy]ous/{EW} printf("%ceful",Y0); +[^e]ous/{EW} printf("%cful",Y0); + +[A-Za-z]+less/{EW} { yytext[yyleng-4] = '\0'; + if (((yytext[1] < 'A') || (yytext[1] > 'Z')) && + (yytext[0] >= 'A') && (yytext[0] <= 'Z')) + yytext[0] = yytext[0] - ('a' - 'A'); + printf("%cn%sful",C('u'), yytext); + } + +". " { printf("%s",yytext); + fcounter &= 15; + if (14 == fcounter++) printf("(fnord) "); + } + +[.,!?]\"([^\n\".!]+[.!])?\n/[\n\t ] printf("%c Hail Big Brother!\"%s",Y0,yytext+2); +\"([.,!?][^\n\".!]+[.!])?\n/[\n\t ] printf("%c Hail Big Brother!\"%s",Y1,yytext+2); + +. printf("%s", yytext); +\n printf("\n"); + +%{ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Brief description of Orwell's NewSpeak: + * --------------------------------------- + * Each word was made to serve as noun, verb, adjective and adverb. In + * particular, nouns and verbs were made exactly the same -- hence "think" + * replaced "thought" as a noun (viz. "crimethink" = thought crime, "thinkpol" + * = thought police). Adjectives were formed by adding "-ful" to a noun/verb; + * adverbs were formed by adding "-wise." Hence "speedful" = fast, + * "speedwise" = quickly, "unspeedwise" = slowly. + * + * The decision on which word should be negated was made fairly randomly; + * "dark" could be "unlight," or "light" could be "undark". But in all cases + * the most important objective (aside from ideological restriction) was + * euphony; the words had to be easily pronounceable. + * + * Most verb inflections were made regular; "he thinked," "he goed," "he + * eated"; only the auxiliaries and modals (to be, to have, may, shall, will, + * etc.) were allowed to inflect irregularly. Plurals were also regularized: + * "mans," "oxes," "childs." [This isn't implemented here.] + * + * There were three sets of words. The A vocabulary was for everyday use: + * car, man, red, good, etc. It was restricted to fairly simple words. + * + * The B vocabulary consisted of political/ideological words with very + * complicated connotations. All of the B words were compound words -- + * bellyfeel (blind emotional acceptance of the ideology), oldthink (the way + * of thought before the Revolution), crimethink, Ingsoc, goodsex (intercourse + * solely for the purpose of making babies and with no physical enjoyment on + * the part of the female), sexcrime (any kind of sex but goodsex, including + * sex for its own sake), goodthink (thinking in accordance with Ingsoc), and + * so on. These words were also subject to the modifications mentioned + * above--hence "goodthinker," "goodthinkful," "goodthinkwise." + * + * The C vocabulary consisted of scientific and technical words (though there + * was no longer any word for "science," any connotation it might have being + * subsumed into "Ingsoc"). + * + * Implementing a translator for all of this would be really complicated -- + * I'd need rather extensive lists of the "irregular" words (so they could be + * regularized), as well as lists of politically meaningful words (so they + * could be excised or translated into either "goodthink" or "crimethink," as + * appropriate). Any kind of sexual topic should become "sexcrime" (it being + * unlikely that any talk of sex these days would fit into "goodsex"). + * + * Basically, the reason it's hard is that NewSpeak was intended to *decrease* + * the vocabulary, and subsume complicated ideas into politically correct + * words so that you wouldn't have to understand the ideas anymore; you'd just + * have to emit the right words. So to properly "translate" anything into + * NewSpeak, you have to cut the vocabulary way down. + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + */ +%} + +%% +main() +{ + yylex(); + printf("\nHail Big Brother!\n"); +} + + +capstring(firstchar,string,i) + char firstchar, *string; + int i; +{ + if (firstchar != 0) putchar(firstchar); + putchar( (yytext[i] <= 'Z') ? (string[0] - ' ') : string[0]); + printf("%s",string+1); +} + +compstring(firstchar,string1,string2,i) + char firstchar, *string1, *string2; + int i; +{ + capstring(firstchar,string1,i); + capstring(0,string2,i); +} + +_caseify(c,i) + char c; + int i; +{ + if (yytext[i] <= 'Z') return (c - ' '); + else return (c); +} + +caseify(c) + char c; +{ _caseify(c,0); } + +caseify1(c) + char c; +{ _caseify(c,1); } diff --git a/nyc.l b/nyc.l new file mode 100644 index 0000000..b00f2b0 --- /dev/null +++ b/nyc.l @@ -0,0 +1,108 @@ +%{ +/* + * Lex filter to transform plain English into Brooklyn English. + * No racial or societal slurs are intended. For amusement only. + * + * Copyright 1986 by Daniel Klein. + * + * Reproduction permitted so long as this notice is retained. + */ +%} +BW [ \t] +SP [ \t] +EW [ \t.,;!\?$] +%% +%{ + void plastc() { + yyunput(yytext[yyleng-1], yytext); + } +%} +".so ".*$ printf("%s", yytext); +[ao]ther printf("%cdder", yytext[0]=='a'?'a':'u'); +[Nn]othing printf("%cuttin'", yytext[0]); +[Tt]hin printf("%cin", yytext[0]); +[Tt]hir printf("%coi", yytext[0]); +[Tt]h[ei] printf("%c%c", caseify('d'), yytext[yyleng-1]); +[Tt]hat printf("%cat", caseify('d')); +I'm{SP}going{SP}to printf("I'manna"); +going{SP}to printf("gonna"); +want{SP}to printf("wanna"); +t{SP}you printf("tcha"); +[Dd]id{SP}you{SP}[eaiou] printf("%c'j%c", yytext[0], yytext[yyleng-1]); +[Dd]id{SP}you printf("%c'ja", yytext[0]); +[Yy]ou printf("%cuh", yytext[0]); +[Hh]ow{SP}are{SP}you printf("%cowahrya", yytext[0]); +[Ww]ith printf("%cit'", yytext[0]); +[Dd]on't printf("%coan", yytext[0]); +ldn't | +dn't printf("n't"); +isn't printf("ain't"); +er{EW} { printf("uh"); plastc(); } +ing{EW} { printf("in'"); plastc(); } +[Ww]ord | +[Hh]eard | +[BbGgLlPpSs]urg | +[CcHh][eu]r[ntv] printf("%coi%c", yytext[0], yytext[yyleng-1]); +[^Mm]mer[^aeiouhrs] printf("%cmoi%c", yytext[0], yytext[yyleng-1]); +[Oo]re{EW} { printf("%cwh", caseify('a')); plastc(); } +[Oo]r printf("%cwh", caseify('a')); +[Oo]f printf("%chv", caseify('u')); +tion printf("shun"); +alk | +our[st] | +or[st] printf("awh%c", yytext[yyleng-1]); +ause printf("awze"); +[Oo]ff printf("%cwhf", caseify('a')); +[Ss]tupid printf("%ctoopid", yytext[0]); +{BW}under printf(" unner"); +{BW}to{EW} { printf(" tuh"); plastc(); } +[Aa]ctual printf("%cckshul", yytext[0]); +negro printf("spade"); +[Pp]uerto{SP}[Rr]ican printf("%cpic", caseify('s')); +[Ii]talian printf("%creaser", caseify('g')); +[Jj]ewish printf("%cew boy", yytext[0]); +[Jj]ew printf("%cebe", caseify('h')); +[a-z]":" { *(yytext+1) = ','; + printf("%s like, uhh:",yytext); + } +[a-z]"?" { *(yytext+1) = ','; + printf("%s or what?",yytext); + } +! printf("! Okay?"); +[a-z]"." { printf("%s", yytext);expletive();} +%% + +caseify(c) +char c; +{ + if (yytext[0] <= 'Z') + return (c - ' '); + else + return (c); +} + +short count = 0; +short which = 0; + +expletive() +{ + if (count++ % 4 == 0) { + switch (which++ % 5) { + case 0: printf(" Okay?"); break; + case 1: printf(" Right?"); break; + case 2: printf(" Yuh got me so fahr?"); break; + case 3: printf(" Ya' dig?"); break; + case 4: printf(" Yuh with me?"); break; + } + } +} + +main() +{ + yylex(); +} + +int yywrap() +{ + return 1; +} diff --git a/pirate b/pirate new file mode 100755 index 0000000..67ad872 --- /dev/null +++ b/pirate @@ -0,0 +1,138 @@ +#!/usr/bin/perl -p + +# an array, not a hash. because order is important +@trans_table=( + '\bmy\b' => 'me', + '\bboss\b' => 'admiral', + '\bmanager\b' => 'admiral', + '\b[Cc]aptain\b' => "Cap'n", + '\bmyself\b' => 'meself', + '\byour\b' => 'yer', + '\byou\b' => 'ye', + '\bfriend\b' => 'matey', + '\bfriends\b' => 'maties', + '\bco[-]?worker\b' => 'shipmate', + '\bco[-]?workers\b' => 'shipmates', + '\bearlier\b' => 'afore', + '\bold\b' => 'auld', + '\bthe\b' => "th'", + '\bof\b' => "o'", + '\bdon\'t\b' => "dern't", + '\bdo not\b' => "dern't", + '\bnever\b' => "no nay ne'er", + '\bever\b' => "e'er", + '\bover\b' => "o'er", + '\bYes\b' => 'Aye', + '\bNo\b' => 'Nay', + '\bdon\'t know\b' => "dinna", + '\bhadn\'t\b' => "ha'nae", + '\bdidn\'t\b' => "di'nae", + '\bwasn\'t\b' => "weren't", + '\bhaven\'t\b' => "ha'nae", + '\bfor\b' => 'fer', + '\bbetween\b' => 'betwixt', + '\baround\b' => "aroun'", + '\bto\b' => "t'", + '\bit\'s\b' => "'tis", + '\bIt\'s\b' => 'It be', + '\bwoman\b' => 'wench', + '\blady\b' => 'wench', + '\bwife\b' => 'lady', + '\bgirl\b' => 'lass', + '\bgirls\b' => 'lassies', + '\bguy\b' => 'lubber', + '\bman\b' => 'lubber', + '\bfellow\b' => 'lubber', + '\bdude\b' => 'lubber', + '\bboy\b' => 'lad', + '\bboys\b' => 'laddies', + '\bchildren\b' => 'minnows', + '\bkids\b' => 'minnows', + '\bhim\b' => 'that scurvey dog', + '\bher\b' => 'that comely wench', + '\bhim\.\b' => 'that drunken sailor', + '\bHe\b' => 'The ornery cuss', + '\bShe\b' => 'The winsome lass', + '\bhe\'s\b' => 'he be', + '\bshe\'s\b' => 'she be', + '\bwas\b' => "were bein'", + '\bHey\b' => 'Avast', + '\bher\.\b' => 'that lovely lass', + '\bfood\b' => 'chow', + '\broad\b' => 'sea', + '\broads\b' => 'seas', + '\bstreet\b' => 'river', + '\bstreets\b' => 'rivers', + '\bhighway\b' => 'ocean', + '\bhighways\b' => 'oceans', + '\bcar\b' => 'boat', + '\bcars\b' => 'boats', + '\btruck\b' => 'schooner', + '\btrucks\b' => 'schooners', + '\bSUV\b' => 'ship', + '\bmachine\b' => 'contraption', + '\bairplane\b' => 'flying machine', + '\bjet\b' => 'flying machine', + '\bdriving\b' => 'sailing', + '\bdrive\b' => 'sail', + '\bwith\b' => "wi'", + '\bam\b' => 'be', + '\bis\b' => 'be', + '\bare\b' => 'be', + '\bwas\b' => 'be', + '\bwere\b' => 'be', + '\bwere\b' => 'be', +); + +while (@trans_table) { + $key=shift @trans_table; + $value=shift @trans_table; + s/$key/$value/g; +} + +s/ing\b/in'/g; +s/ings\b/in's/g; +s/(\.( |\t|$))/avast($1,3)/eg; +s/([!\?]( \t|$))/avast($1,2)/eg; # Greater chance after exclamation +s/\Br\B/roll()/eg; + +sub roll { + return 'r' x (rand(5)+1) if rand > 0.5; + return 'r'; +} + +sub avast { + my $stub=shift; + my $chance=shift; + + my @shouts=( + ", avast$stub", + "$stub Ahoy!", + ", and a bottle of rum!", + ", by Blackbeard's sword$stub", + ", by Davy Jones' locker$stub", + "$stub Walk the plank!", + "$stub Aarrr!", + "$stub Yaaarrrrr!", + ", pass the grog!", + ", and dinna spare the whip!", + ", with a chest full of booty$stub", + ", and a bucket o' chum$stub", + ", we'll keel-haul ye!", + "$stub Shiver me timbers!", + "$stub And hoist the mainsail!", + "$stub And swab the deck!", + ", ye scurvey dog$stub", + "$stub Fire the cannons!", + ", to be sure$stub", + ", I'll warrant ye$stub", + "$stub Arr, me hearty!", + ); + + if (int rand($chance) == 1) { + return @shouts[rand @shouts]." "; + } + else { + return $stub; + } +} diff --git a/rasterman b/rasterman new file mode 100755 index 0000000..2f36574 --- /dev/null +++ b/rasterman @@ -0,0 +1,101 @@ +#!/usr/bin/perl + +$row = "!qwertyuiop!asdfghjkl!zxcvbnm!"; +@row_array = split(//, $row); + +while (<>) { + chomp; + y/A-Z/a-z/; + s/\byou\b/u/gi; + s/\bpeople\b/ppl/gi; + s/\bthrough\b/thru/gi; + s/\bthough\b/tho/gi; + s/\bnope\b/nup/gi; + s/\baustralia\b/oz/gi; + s/\bfilm\b/flim/gi; + s/\bsucks\b/sux/gi; + s/\benough\b/enuff/gi; + s/\ba lot\b/a shitload/gi; + s/\bstuff\b/shit/gi; + s/, /.. /g; + s/\.$/.../g; + + @lets = split(//); + + $strlen = $#lets; + + for ($x = 0; $x < $strlen; $x++) { + if (rand() < 0.01) { + swap(\@lets, $x, $x + 1); + next; + } + + if (rand() < 0.10 && $lets[$x] eq " ") { + swap(\@lets, $x - 1, $x - 2); + next; + } + + if(rand() < 0.01) { + $i = insert_adjacent(\@lets, $x, $lets[$x]); + $strlen += $i; + next; + } + + if(rand() < 0.01) { + splice(@lets, $x, 1); + $strlen--; + next; + } + } + + print join("", @lets) . "\n"; +} + +sub insert_adjacent { + my($aref, $pos, $let) = @_; + + + $newlet = get_adjacent($let); + + if( !$newlet ) { + return 0; + } + + splice(@$aref, $pos + 1, 0, $newlet); + return 1; +} + + +sub get_adjacent { + my($let) = @_; + + return 0 if $let !~ /[a-zA-Z]/; + + $i = index($row, $let); + $before = $row_array[$i - 1]; + $after = $row_array[$i + 1]; + + + + if( $before eq "!" || (rand() < rand() && $after ne "!")) { + return $after; + } else { + return $before; + } +} + +sub swap { + my($aref, $n, $m) = @_; + my($tmp); + + if(defined($$aref[$n]) && defined($$aref[$m])) { + if(! (($$aref[$n] =~ /[A-Z ]/ && $$aref[$m] =~ /[A-Z ]/) || + ($$aref[$n] =~ /[a-z ]/ && $$aref[$m] =~ /[a-z ]/) )) { + return; + } + $tmp = $$aref[$n]; + $$aref[$n] = $$aref[$m]; + $$aref[$m] = $tmp; + } +} + diff --git a/scottish b/scottish new file mode 100755 index 0000000..805b1da --- /dev/null +++ b/scottish @@ -0,0 +1,51 @@ +#!/usr/bin/perl -w +# Fake scottish (dwarven) accent filter, by Adam Borowski, inspired by the +# character "Durkon" from Order of the Stick by Rich Burlew. GPL, 2007. +use strict; + +my @repl=qw( + ^yes$:aye there:thar eir$:ar + about:aboot ^he$:'e them:'em + ^him:'im out_of$:outta of_course:'course + ^of$:o' ^and$:an' to$:ta + tog:tag that:tha the:tha + wouldn't:wouldn'ta cannot:cannae can't:cannae + don't:dinnae 're$:r for$:fer + ver$:'er ber$:b'r every$:ev'ry + en$:'n ^if$:if'n enl:'nl + eng:'ng ing:in' ment:mn't + ^es:'s ^ex:'s ^not$:na + ^no$:nay n't_have:n'tve ^is$:be + ^are$:be have:haf abl:'bl + ^you$:ye ^your:yer ^you':ye' + noth:nuth ^this$:'tis ^here:'ere + doesn't:don't at_a$:atta ith$:it' + ered$:'red into$:inta ^before:'fore + wit'_':wit_' wit'_t:wit_t wit'_w:wit_w + wit'_y:wit_y get_a:git_a ally$:'lly + ^my:me ^i_think$:methinks nay_w:na_w + ^one$:'un ^'un_a:one_a at_ta$:atta + ot_ta$:otta ^isn't$:ain't ^so_th:s'th + ned$:n'd ^because:'cause +), my @r; + +sub firstu($) { + $_[0]=~s/^([^a-z]*)([a-z])/$1\u$2/; + return $_[0]; +} + +for(@repl) { + s/_/ /g; + my ($l,$r)=split(/:/,$_); + for([$l,$r], [firstu $l, firstu $r], ["\U$l","\U$r"]) { + ($l,$r)=@$_; + $l=~s/^\^/\\b/; + $l=~s/\$$/\\b/; + push @r, [qr/$l/, $r]; + } +} + +while(my $txt=<>) { + $txt=~s/$$_[0]/$$_[1]/g for @r; + print $txt; +} diff --git a/scramble.dir/Makefile b/scramble.dir/Makefile new file mode 100644 index 0000000..4b4e7cd --- /dev/null +++ b/scramble.dir/Makefile @@ -0,0 +1,5 @@ +../scramble: scramble.c + $(CC) -o $@ $< -O2 -g + +clean: + rm -f ../scramble diff --git a/scramble.dir/scramble.c b/scramble.dir/scramble.c new file mode 100644 index 0000000..fc35ff8 --- /dev/null +++ b/scramble.dir/scramble.c @@ -0,0 +1,205 @@ +/* Scramble the "inner" letters of each word in the input into a random order, and output the result. Non-word (that is, non-alphabetical) characters, and the first and last letters of each word, are left alone. + * Output to something other than stdout will append to the file instead of overwriting it - this may be undesirable, and can be changed if so. + */ + +/* Copyright 2009-07-11 Andrew J. Buehler. + */ + +/* This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include +#include // for isalpha() +#include // for malloc()/calloc()/realloc()/free() and rand()/srand() +#include // for strlen() +#include // for time() + +#define ALLOW_FILE_IO 0 + + +/* strips 'reduction' characters from the end of the input string and returns the result + * works only if strlen(string> >= reduction, which is the case in the only place it is presently called + */ +char *shorten_string(char *string, int reduction) { + int i; + + i = strlen(string); + + for (; reduction > 0; reduction--, i--) { + string[i-1] = '\0'; // would it work to use an 'i-reduction' approach instead, similar to what was later done in narrow_string()? + } + + return string; +} + +/* strips 'reduction' characters from the beginning and the end of the input string and returns the result + * works only if(strlen(string) >= 2*reduction), which is the case in the only place it is presently called + */ +char *narrow_string(char *string, int reduction) { + int i = reduction; + + while(string[i]) { + string[i-reduction] = string[i]; + i++; + } + string[i-reduction] = '\0'; + + return shorten_string(string, reduction); +} + +int all_one_letter(char *string) { + char c; + int i; + + c = string[0]; + for(i = 1; string[i] != '\0'; i++) { + if(c != string[i]) { + return 0; // a nonduplicate letter has been found + } + c = string[i]; + } + + return 1; // reached the end of the string having found only duplicate letters, so it's all one letter +} + +/* randomly reorders the contents of the string + * WARNING: frees the input string and returns a replacement + */ +char *scramble_string(char *string) { + char *ret, *tmpstr; + int len, i, j; + + len = strlen(string); + if(len < 2) return string; // can't scramble a 1-character string or an empty string! + if(all_one_letter(string)) return(string); // can't scramble a string which consists entirely of one letter! + + ret = strdup(string); + + while(strcmp(string, ret) == 0) { + j = 0; + tmpstr = strdup(string); + while(len > 0) { + i = rand() % len; + ret[j] = tmpstr[i]; + j++; + while(tmpstr[i] != '\0') { + tmpstr[i] = tmpstr[i+1]; + i++; + } + len--; + } + free(tmpstr); + len = strlen(string); + } + + + free(string); + return ret; +} + +char *clear_string(char *string) { + int i; + + i = strlen(string); + + for(; i >= 0 ; i--) { + string[i] = '\0'; + } + + return string; +} + +int main(int argc, char **argv) { + int word_length; + char c, tempchar, *word; + FILE *infile, *outfile; + +#if ALLOW_FILE_IO + /* open files, if any other than stdin and stdout */ + if(argc > 1) { + if(!strcmp(argv[1], "--help") || + !strcmp(argv[1], "-h")) { + printf("Usage: %s [INPUT_FILENAME] [OUTPUT_FILENAME]\n", argv[0]); + printf("If INPUT_FILENAME is omitted or is '-', read from standard input\nIf OUTPUT_FILENAME is omitted or is '-', print to standard output\n"); + return 0; + } + + if(strcmp(argv[1], "-")) { + infile = fopen(argv[1], "r"); + if(infile == NULL) { + fprintf(stderr, "Unable to open input file %s for reading\n", argv[1]); + return 1; + } + } else { + infile = stdin; + } + + if(argc > 2) { + if(strcmp(argv[2], "-")) { + outfile = fopen(argv[2], "a"); + if(outfile == NULL) { + fprintf(stderr, "Unable to open output file %s for writing\n", argv[2]); + return 2; + } + } else { + outfile = stdout; + } + } + } else { // no arguments specified + infile = stdin; + outfile = stdout; + } +#else + infile = stdin; + outfile = stdout; +#endif + + srand(time(NULL)); // needed for scramble_string() to actually be random + + word_length = 0; + word = malloc(sizeof(char)); + word[0] = '\0'; + c = fgetc(infile); + + if(feof(infile)) { + printf("Reached EOF while reading the first character of the input file!\n"); + return 4; + } + + while(!feof(infile)) { + if(isalpha(c)) { + word = realloc(word, word_length+2); // one for the new character, one for the null + word[word_length] = c; + word[word_length + 1] = '\0'; // duplicate addition with the next line, but possibly more readable + word_length++; + } else { + if(word_length) { + word_length--; + fputc(word[0], outfile); + if(word_length) { + tempchar = word[word_length]; + word = scramble_string(narrow_string(word, 1)); + fprintf(outfile, "%s", word); + fputc(tempchar, outfile); + } + word = clear_string(word); + word_length = 0; + } + fputc(c, outfile); + } + fflush(outfile); + c = fgetc(infile); + } + + free(word); + return 0; +} diff --git a/spammer b/spammer new file mode 100755 index 0000000..678e827 --- /dev/null +++ b/spammer @@ -0,0 +1,196 @@ +#!/usr/bin/perl +# Talk like a spammer. Copyright 2002 by Joey Hess +# Licensed under the GPL. +# +# Doesn't always generate proper engrish, but then neither do +# spammers. + +sub c { + return $_[rand @_]; +} + +sub line_of_yelling { + my @lines=split(/\n/, shift); + my $n=rand @lines; + $lines[$n] = uc($lines[$n]); + return join("\n", @lines); +} + +sub for_free { + return c(qw(100% completely totally absolutely))." ".c(qw(f F))."ree"; +} + +my $hits=0; + +if (rand > 0.75) { + $hits++; + $spam .= "Dear Friend, "; +} +elsif (rand > 0.9) { + $hits++; + $spam .= "Below is the result of your feedback form".c(qw{: . ..})."\n"; +} +elsif (rand > 0.75) { + $hits++; + $spam .= "This message is not spam!\n"; +} + +while (<>) { + # Try to trigger spam trappers. Keep count of the number of unique + # ones triggered. + @results = ( + s/^(Subject:\s+.*)/$1. ' ' x (rand(20) + 40) . rand(1000000)/eig, + s/free\b/for_free()/eig, + s/(email|message|e-mail|mail)\b/$1 (sent in compliance with regulations)/i, + s/(join|register|order|apply)/$1 today/ig, + s/money/big bucks/i, + s/check\b/check or money order/i, + s/(amazing|atonishing|neat|interesting)/AMAZING/ig, + s/guarantee\b/GUARANTEE/ig, + s/(profits|money)/PROFITS/ig, + s/(no questions asked|quiet|confidential|secret)\b/NO QUESTIONS ASKED/ig, + s/refund\b/full refund/i, + s/free\b/FREE/ig, + s/\b(full|complete|fully)\b/100% GUARANTEED/ig, + s/(spam|UCE)\b/c(qw(bulk direct mass))." email"/eig, + s/spammer/businessman/ig, + s/(call|phone|contact)\b/CALL NOW/ig, + s/business\b/online business/ig, + s/online\b/online business opportunities/ig, + s/number\b/social security number/ig, + s/addresses\b/addresses on cd/ig, + s/cdrom\b/addresses on cd/ig, + s/click\b/click here/ig, + s/viagra/c('VIAGRA', 'natural viagra', 'herbal viagra')/eig, + s/\btraffic\b/rand > 0.6 ? 'more web traffic' : 'traffic'/eig, + s/targeted/targeted traffic/ig, + s/limited/LIMITED TIME OFFER/ig, + s/buy\b/buy direct/ig, + s/profit\b/PURE PROFIT/ig, + s/opportunity/once in a lifetime opportunity/ig, + s/stock\b/STOCK PICK/ig, + s/access\b/INSTANT ACCESS/ig, + s/(diploma|credential)s?/college diploma$a/ig, + s/(penis|breast)/larger $1/ig, + s/\b(work|job)\b/home employment/ig, + s/experience\b/no experience needed!/ig, + s/printer\b/printer (toner cartridge)/ig, + s/(income|money|savings?)\b/you income/ig, + s/(amazing|amazed|atonished|interesting)/be amazed/ig, + s/(\$\d+\.?\d*)/for only $1!/ig, + s/natural/completly natural/ig, + s/obligation/no obligation/ig, + s/vacation\b/c(qw(dream special free))." vacation"/eig, + s/sign up\b/sign up today/ig, + s/cell (phone)?\b/free cell phone/ig, + s/(offer|trial|membership|website|quote|installation|sample|dvd|preview|leads)\b/free $1/ig, + s/\bvalue/outstanding value/ig, + s/shipping/shopping spree/ig, + s/winning/WINNING/ig, + s/winner\b/WINNER/ig, + s/promotion\b/special promotion/ig, + s/password\b/free password/ig, + s/\bcash\b/extra cash/ig, + s/cancel\b/cancel at any time/ig, + s/\bearn\b/earn up to/ig, + s/(movies|pics|photos|videos)/c(qw(hundreds thousands millions tons))." of $1"/eig, + s/\bporn\b/free porn/ig, + s/\blegal\b/c(qw(absolutely perfectly totall 100%))." legal"/eig, + s/(drugs|medications|pharmacy)/online $1/ig, + s/asset/hidden asset/ig, + s/\bsave\b/save thousands/ig, + s/partner/marketing partner/ig, + s/unlimited/UNLIMITED/ig, + s/\bprice\b/low price/ig, + s/galleries\b/huge galleries/ig, + # Convert phone numbers to 800 numbers. + s/(?:(?:1-)?[0-9]{3}-)?([0-9]{3}-[0-9]{4})/"1-".c(800,888)."-$1"/eg, + # de-http:// urls + s/http:\/\///ig, + ); + + # Merge result table into an overall results table that counts each + # item at most once. + for ($x=0; $x < $#results; $x++) { + if ($results[$x]) { + $overallresults[$x]=1; + } + } + + # Cute things that don't cause real hits. + s/\.(com|org|net|edu)\b/".".c(qw(info biz name))/eig; + s/([Ee])nglish/${1}ngrish/g if rand > 0.66; + $spam .= $_; +} + +$hits += $_ foreach @overallresults; + +if (rand > 0.5) { + # random line breaks make spam look + # more professional + # or is it just written in Notepad? + $spam =~ s/ /rand > 0.95 ? "\n" : " "/eg; +} +elsif (rand > 0.75) { + # I write my spam in MS WORD! + $spam =~ s/\n/ /g; +} +else { + $spam=line_of_yelling($spam); +} + +if (rand > 0.8 || $hits < 5) { + $spam .= "\nThis is a ".c(qw(one 1))." time ".c(qw(email e-mail offer)).c(qw(! .)); + $hits++; +} + +if (rand > 0.7 || $hits < 5) { + $spam .= "\n" . c('-' x 78, '~' x 70, '---', '', '', '', "\n\n\n\n") . "\n" . + c('To remove your address from ', 'To be removed from', 'To get off from', + 'To unsubscribe from', 'To receive no further notices on', + 'If you did not opt in for', 'To be removed from future mailings to') . + " " . + c('this mailing list', 'these mails') . " " . + c('please ', '') . + c('reply', 'send an email', 'write back') . " " . + c('with a subject of', 'and put in the subject the word') . " " . + c("REMOVE", '"remove"') . + c(qw(! . .)) . "\n"; + $hits++; +} + +# Desperate to make it look like a spam now, I insert arbitrary +# junk. +while ($hits < 5) { + if (rand > 0.66) { + $spam=line_of_yelling($spam); + $hits++; + } + elsif (rand > 0.5) { + # Insert a spam phrase after the end of a sentence. + @spam_phrases = ('FREE CONSULATATION', 'INSTANT ACCESS', + 'PURE PROFIT', 'STOCK PICK', 'VIAGRA', 'WINNER', + 'WINNING', 'LIMITED TIME OFFER', 'extra cash', + 'CALL NOW', 'once in a lifetime opportunity', + 'cancel at any time', 'no experience needed', + 'no obligation', 'save millions', 'be amazed', + for_free()); + $hits += $spam =~ s/\.\s+([A-Z])/". ".ucfirst(c(@spam_phrases)). "! $1"/es; + } + elsif (rand > 0.75) { + # large hexadecimal block + my @hex = ('A'..'F', 0..9); + for (1..70 + rand(9)) { + $spam .= $hex[rand @hex]; + } + $spam .= "\n"; + $hits++; + } + elsif (rand > 0.75) { + $spam .= c("SSPLTM ", "{%RAND%} "); + $hits++; + } +} + +$spam =~ s/\n/\r\n/g; +print "$spam\n"; diff --git a/studly b/studly new file mode 100755 index 0000000..21a4d02 --- /dev/null +++ b/studly @@ -0,0 +1,13 @@ +#!/usr/bin/perl + +# stUdLy cAPs, after emacs studly.el -- the commented line is just +# to remind diehards how it *should* be done ;) +# +# just for reference, you may do whatever you like with this file. +# +# -- nwp@lemon-computing.com + +for (my $offset = 0; defined(my $c = getc); $offset++) { +# (($c + $offset) % 4) == 2 and print (ord($c) ^ 32) or print($c); + (($c + $offset) % 4) != 2 and print($c) or $c =~ tr/[A-Za-z]/[a-zA-Z]/, print $c; +} diff --git a/uniencode b/uniencode new file mode 100755 index 0000000..2a80c0d --- /dev/null +++ b/uniencode @@ -0,0 +1,88 @@ +#!/usr/bin/perl +# Ⅽоηνеrt аѕⅽіі tօ υtf‐8. +use utf8; +binmode STDOUT, ":utf8"; + +%Δ=( +"~" => [], +"!" => [], +"@" => [], +"#" => [], +'$' => [], +"%" => [8240], +"^" => [], +"&" => [], +"*" => [10033], +"(" => [], +")" => [], +"_" => [9418], +"-" => [8208], +"+" => [], +"=" => [], +"[" => [], +"]" => [], +"{" => [], +"}" => [], +'\\' => [], +"|" => [9475], +'"' => [8223], +"'" => [8217], +":" => [], +";" => [], +"<" => [8249], +">" => [8250], +"," => [], +"." => [], +"/" => [8260], +"?" => [], + +"1" => [], +"2" => [], +"3" => [1047], +"4" => [], +"5" => [], +"6" => [], +"7" => [], +"8" => [], +"9" => [], +"0" => [1365], + +"a" => [1072], "A" => [1040], +"b" => [1068], "B" => [1042], +"c" => [1089, 8573, 1010], "C" => [663, 1057, 8557], +"d" => [1281, 8574], "D" => [8558], +"e" => [1077], "E" => [917, 1045], +"f" => [], "F" => [988], +"g" => [], "G" => [1292], +"h" => [1210], "H" => [919, 1053], +"i" => [1110, 8560], "I" => [921, 1030], +"j" => [1011, 1112], "J" => [1032], +"k" => [], "K" => [922, 1050], +"l" => [8572], "L" => [8556], +"m" => [8575], "M" => [924, 1052, 8559], +"n" => [951, 627], "N" => [925], +"o" => [1086, 1413], "O" => [927, 1054], +"p" => [961, 1088], "P" => [929, 1056], +"q" => [], "Q" => [], +"r" => [], "R" => [], +"s" => [1109], "S" => [1359], +"t" => [], "T" => [932, 1058], +"u" => [965], "U" => [], +"v" => [957, 8910, 8964, 9013], "V" => [947, 8548], +"w" => [], "W" => [], +"x" => [1093, 8569, 215], "X" => [935, 1061, 8553], +"y" => [1059, 1091], "Y" => [933], +"z" => [], "Z" => [918], +); + +while (<>) { + foreach $ם (split //) { + if (exists $Δ{$ם} && @{$Δ{$ם}}) { + @ה=@{$Δ{$ם}}; + print chr($ה[rand @ה]); + } + else { + print $ם + } + } +} diff --git a/upside-down b/upside-down new file mode 100755 index 0000000..c8f57e2 --- /dev/null +++ b/upside-down @@ -0,0 +1,3 @@ +#!/usr/bin/perl -pl- +$_=reverse lc$_;s@"@''@g;y/[]{A-R}<>()a-y1-9,!.?`'/][} Joey Hess +{><)(eq)paj6y!fk7wuodbjsfn^mxhl2Eh59L86`i'%,/;s@k@>|@g# joey@kitenet.net -- 2.30.2