+filters (2.14) unstable; urgency=low
+
+ * Hahaha. Added a rasterman filter. (Not just "raster" as I worry about
+ namespace pollution.)
+
+ -- Joey Hess <joeyh@debian.org> 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
> and nyc filters to the GPL? Is that correct? I'd love to move them into
> Debian proper.
+The rasterman filter was pulled out of
+http://www.xach.com/xachbot/xachbot-2000-07-15.tar.gz, which is as a whole
+copyright (C) 1997 Zachary Beane and is GPL'd.
+
Everything else is copyright 1999 by Joey Hess, under the terms of GPL.
.TH FILTERS 6
.SH NAME
-b1ff, chef, cockney, eleet, jethro, jibberish, jive, kraut, nyc, upside-down \- assorted text filters
+b1ff, chef, cockney, eleet, jethro, jibberish, jive, kraut, nyc, rasterman, upside-down \- assorted text filters
.SH SYNOPSIS
$SHELL | chef
.SH "DESCRIPTION"
Generates text with a German accent.
.IP nyc
Brooklyn English
+.IP rasterman
+Makes text look like it came from the keyboard of Carsten Haitzler.
.IP upside-down
Flips text upside down. Stand on your head and squint to read the output.
.SH "SEE ALSO"
--- /dev/null
+#!/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/\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;
+ }
+}
+