* Added a censor filter.
authorjoey <joey@a4a2c43b-8ac3-0310-8836-e0e880c912e2>
Mon, 4 Nov 2002 01:32:40 +0000 (01:32 +0000)
committerjoey <joey@a4a2c43b-8ac3-0310-8836-e0e880c912e2>
Mon, 4 Nov 2002 01:32:40 +0000 (01:32 +0000)
   * 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 <ahem> standards of irc circa mid 2002.
   * Make jibberish filter only run text through 3 to 8 of the other filters.
   * Various improvements.

12 files changed:
Makefile
README
b1ff
censor [new file with mode: 0755]
debian/TODO
debian/changelog
debian/control
debian/copyright
eleet
filters.6
jibberish
studly

index d4b7344b0f3ef9da29ee4543c8cf6cf3735a2aff..c64135fd08a17aebdfea3565218d7c02aa937457 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
 LEX    = flex
 BUILD  = jethro kraut cockney jive nyc ken ky00te newspeak
-OTHER  = eleet b1ff chef jibberish upside-down rasterman studly fudd
+OTHER  = eleet b1ff chef jibberish upside-down rasterman studly fudd censor spammer
 CFLAGS = -O2
 INSTALL_PROGRAM = install
 
diff --git a/README b/README
index dec7b072613504676fedc24a50e7aa6ebbf63b97..1857f62ed72f57edc99a0601bf9032da9f52a95e 100644 (file)
--- a/README
+++ b/README
@@ -1,5 +1,6 @@
 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. 
+B1ff, the Swedish Chef, and an eleet filter are included, along with many,
+many more.
 
 Since the original versions of some of these filters have copyright
 problems, I have done a "clean room" re-implementation of the original lex
diff --git a/b1ff b/b1ff
index f958c0f2fe2a141a3594f340cdcf3538b6cc5e89..0f1ad43e83ffbea6988da6936b195084168a7a62 100755 (executable)
--- a/b1ff
+++ b/b1ff
@@ -53,6 +53,7 @@
        'ER' => 'UR',
        'S+\b' => 'Z',
        'KN' => 'N',
+       'IE' => 'EI',
 );
 
 $_=uc;
diff --git a/censor b/censor
new file mode 100755 (executable)
index 0000000..2d46963
--- /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=<IN>;
+       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 ' ', $_ } <DATA>);
+                       close DATAOUT;
+                       exit;
+               }
+       }
+}
+
+$censored = join("|", reverse sort { $a cmp $b } 
+               grep { length $_ }
+               map { chomp; y/a-z/n-za-m/; split ' ', $_ } <DATA>);
+
+while (<>) {
+       s/\b($censored)ed/CENSORED/ig; # don't say "CENSOREDed"
+       s/\b($censored)/CENSORED/ig;
+       print $_;
+}
+
+__DATA__
+ahqr           enaql           grng            pbzrvat         t\f+fcbg
+anxrq          encr            guebng          pbzvat          tebva
+avccyr         erne            gvg             pebgpu          ubbgre
+bcravat                fangpu          gvggl           penc            ubeal
+beny           fchax           gvggvr          penpx           ubyr
+betl           fcrez           hgrehf          pernz           uhzc
+betnfz         fcuvapgre       ihyin           phag            unaqwbo
+certanag       fghq            intvan          phz             urnq
+cevpx          fgnss           ivetva          phzzvat         wvfz
+chff           fhpx            ivoengbe        pnzr            xabo
+chffl          fjnyybj         jbzo            preivk          xvff
+chffvrf                fperj           jrg             pureel          ybir
+chovp          frk             juber           pyvg            ybire
+chqraqhz       frkhny          kkk             pyvgbehf        ybirq
+chzc           frrq            nany            pyvggl          ybnq
+cnagvrf                frzra           nerbyn          pyvznk          ynovn
+crargengr      funsg           nff             qevyyrq         ynvq
+crargengrq     funt            nffubyr         qrsybjre        yrfovna
+cravf          funttvat        obbo            qvpx            yvcf
+crgre          fuvg            oernfg          qvyqb           znfgheong
+crpxre         fyhg            ohgg            rebgvp          znfgheongr
+cunyyhf                fyhggvfu        ohggbpx         rerpgvba        znfgheongvat
+cvff           fyvg            onyy            rkcbfrq         znzznel
+ebfrohq                gbathr          ovgpu           shpx            znzznevrf
+ebq            gbby            oybj            snpvny
+ehg            gjng            pbpx            t-fcbg
index 053a6de290be760ed4834ad68a5483710b8e482a..a1a7bfcf34d6cc32e52bdf24765a6c429e181c47 100644 (file)
@@ -1,3 +1,3 @@
-* censor filter (should be easy)
 * 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?
index 7bdbd90da794c27db7d75ddcd9732c6856542b15..d15f7922684fa8384988ba2e8a62a4a037f5808b 100644 (file)
@@ -1,3 +1,15 @@
+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 <ahem> standards of irc circa mid 2002.
+  * Make jibberish filter only run text through 3 to 8 of the other filters.
+  * Various improvements.
+
+ -- Joey Hess <joeyh@debian.org>  Sun,  3 Nov 2002 16:37:12 -0500
+
 filters (2.26) unstable; urgency=low
 
   * Don't use dh_installmanpages.
index e5c96d18dcc766c9dc32d5aeac38913f93aa3953..e6048b52cc3bc515cf16315933fca753a6168573 100644 (file)
@@ -3,7 +3,7 @@ Section: games
 Priority: optional
 Build-Depends: debhelper (>= 4), flex, bison | byacc | btyacc, dpkg-dev (>= 1.9.0)
 Maintainer: Joey Hess <joeyh@debian.org>
-Standards-Version: 3.5.6.1
+Standards-Version: 3.5.7.0
 
 Package: filters
 Architecture: any
index 2896a5741c4ae9ddcb57ff6d09af3db4ebff8115..cd0bfa4132659fb920297addf24a4cac1e9c33e1 100644 (file)
@@ -1,9 +1,7 @@
 This is a Debian prepackaged version of the filters package.
 
 This package was put together and debianized by Joey Hess
-<joeyh@debian.org>, using sources from
-       http://qz.to/~eli/src.html and
-       ftp://ftp.funet.fi/pub/misc/old-hsu-archive/unsorted/2/kraut.shar.gz
+<joeyh@debian.org>, using sources from all over.
 
 The jethro filter has this copyright:
   **   Public domain. Use at your own risk. Y'all come back now, heah?
@@ -97,6 +95,6 @@ has the following license statement:
 
 # just for reference, you may do whatever you like with this file.
 
-Everything else is copyright 1999-2001 by Joey Hess, under the terms of GPL.
+Everything else is copyright 1999-2002 by Joey Hess, under the terms of GPL.
 The full text of the GNU GPL can be found in /usr/share/common-licenses/GPL
 on Debian systems.
diff --git a/eleet b/eleet
index 017d9eba6bd4b0054c298a39c37ccbebd7317de0..9e0fb77c705f10d63bce582cc8ca456109fad06a 100755 (executable)
--- a/eleet
+++ b/eleet
@@ -1,13 +1,19 @@
 #!/usr/bin/perl -p
-# Eleet filter, Copyright 1999 by Joey Hess under the terms of the GNU GPL.
+# Eleet filter, Copyright 1999,2002 by Joey Hess under the terms of the GNU GPL.
 BEGIN {
-       $transstring="4bcd3fgh1jklmn0pqr5+uvwxyz";
-       $t="tr/a-zA-Z/$transstring".uc($transstring)."/";
+       #             abcdefghijklmnopqrstuvwxyz
+       $transstring="4bcd3fgh1jklmn0pqr5tuvwxyz";
+       $t="tr/a-zA-Z/$transstring$transstring/";
 }
+s/porn/pr0n/g;
+s/elite/l33t/g;
 eval $t;
-s:h:|-|:ig;
-s:l:|_:ig;
-s:m:/\\/\\:ig;
-s:n:/\\/:ig;
-s:v:\\/:ig;
-s:x:><:ig;
+
+# 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;
index 949974024cf14e2aa110a92800fbb8f9fbbb287d..62f8b56eed177885873eb27548be9f0c7eb16d11 100644 (file)
--- a/filters.6
+++ b/filters.6
@@ -1,8 +1,14 @@
 .TH FILTERS 6
 .SH NAME
-ken, b1ff, chef, cockney, eleet, fudd, jethro, jibberish, jive, kraut, ky00te, newspeak, nyc, rasterman, studly, upside-down \- assorted text filters
+ken, b1ff, censor, chef, cockney, eleet, fudd, jethro, jibberish, jive, kraut, ky00te, newspeak, nyc, rasterman, spammer, studly, upside-down \- assorted text filters
 .SH SYNOPSIS
  $SHELL | chef
+ newspeak < thesis.tex > newthesis.tex
+
+ eleet | wall # b1ff works well too
+
+ b1ff | bitchx | censor
 .SH "DESCRIPTION"
 All of these programs are filters to do all sorts of strange things to text.
 No racial or societal slurs are intended. For amusement only.
@@ -24,7 +30,8 @@ Hillbilly text filter
 .IP jive
 Jive English
 .IP jibberish
-Runs text through all the rest of the filters, to make really weird output.
+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.
@@ -35,10 +42,14 @@ This program places a very cute (and familiar to FurryMuck
 fans) accent on any text file.
 .IP newspeak
 A-la-1984
+.IP censor
+CDA-ize text
 .IP nyc
 Brooklyn English
 .IP rasterman
 Makes text look like it came from the keyboard of Carsten Haitzler.
+.IP spammer
+Turns honest text into something that is liable to be flagged as spam.
 .IP studly
 Studly caps.
 .IP upside-down
@@ -46,9 +57,9 @@ 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.
-.SH AUTHOR
-The eleet, upside-down, chef, and b1ff filters were written by Joey
-Hess <joey@kitenet.net>. Daniel V Klein <dvk@lonewolf.com> wrote the
+.SH AUTHORS
+The eleet, upside-down, chef, b1ff, and censor filters were written by
+Joey Hess <joey@kitenet.net>. Daniel V Klein <dvk@lonewolf.com> wrote the
 cockney, jive, and nyc filters. jibberish is by Raul Miller
 <rdm@test.legislate.com>, jethro is by Duane Paulson
 <ci922@cleveland.freenet.edu>, rasterman is by Zachary Beane, ken is by
index d5197b82562549e6bbe849a4dd4f94470b633240..b4f219d799a6a61a32fe48d544cc6759bded3a2e 100644 (file)
--- a/jibberish
+++ b/jibberish
@@ -1,5 +1,5 @@
 #!/usr/bin/perl
-# jibberish -- run all filters in random order
+# jibberish -- run filters in random order
 
 $ENV{PATH}.=":/usr/games";
 
@@ -18,6 +18,8 @@ ky00te
 rasterman
 newspeak
 studly
+censor
+spammer
 );
 
 # shuffle order
@@ -30,9 +32,9 @@ for (0..$#all) {
 }
 
 # start the pipe...
-my $pipe= join '|', @all;
+my $pipe= join '|', @all[0..3 + rand(5)];
 open FILTER, "$pipe|"
-       or die "&quot;Never mind...\n";;
+       or die "Never mind...\n";
 
 # display the results
 while (<FILTER>) {
diff --git a/studly b/studly
index 8e69d9bacc705fbe55fab446d441a0996e670241..21a4d02dd70a0dc7569c16bb1fa76dab2ec593ee 100755 (executable)
--- a/studly
+++ b/studly
@@ -11,4 +11,3 @@ 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;
 }
-
This page took 0.022416 seconds and 4 git commands to generate.