]>
Commit | Line | Data |
---|---|---|
1 | This is a collection of filters to do all sorts of strange things to text. | |
2 | B1ff, the Swedish Chef, and an eleet filter are included, along with many, | |
3 | many more. | |
4 | ||
5 | Since the original versions of some of these filters have copyright | |
6 | problems, I have done a "clean room" re-implementation of the original lex | |
7 | filters in perl. I did this without looking at the original code to the | |
8 | filters at all, I simply observed their output and drew my own conclusions, | |
9 | and wrote my own code. Then I compared the output of the original and new | |
10 | filters when ran on large bodies of text, and fixed the things I had | |
11 | missed. | |
12 | ||
13 | Here are the results of my investigations of how the filters work: | |
14 | ||
15 | eleet: | |
16 | This is the simplest filter to figure out. The letters a-z of | |
17 | the alphabet are replaced with the following letters: | |
18 | 4 b c d 3 f g h 1 j |< l /\/\ /\/ 0 p q r 5 + u \/ \/\/ >< y z | |
19 | Note that the equivalent translation is done on upper-case letters. | |
20 | ||
21 | fudd: | |
22 | ||
23 | This one is trivial too. A few transpositions happen differently if | |
24 | the letter is at the end of the word or not, and I think I found | |
25 | all the transpositions with only a few paragraphs of sample output. | |
26 | The only weird thing is that 'n.' is changed to "n, uh-hah-hah-hah." | |
27 | (Works well with sentances ending in "gun." ..) | |
28 | ||
29 | chef: | |
30 | Personally my favorite filter. This took a bit of work to figure | |
31 | out, and I doubt I have everything correct. Note that due to a bug | |
32 | or an odd feature of the original program, it doesn't seem to think | |
33 | that the first letter of the first word is really the first letter | |
34 | of a word and so some of the words below don't trigger for that first | |
35 | word. I did not emulate this behavior because I think it's probably a | |
36 | bug. | |
37 | ||
38 | The word "bork" is never changed, no matter what any of these | |
39 | rules may say. Neither is "Bork". | |
40 | ||
41 | The following translations only happen to letters that are the first | |
42 | letter of a word of at least 2 letters in size: | |
43 | o -> oo | |
44 | O -> Oo | |
45 | ||
46 | These happen to letters that are not the last letter of a word: | |
47 | a -> e | |
48 | A -> e | |
49 | ||
50 | These translations only happen if the letter is not the first letter | |
51 | of a word: | |
52 | f -> ff | |
53 | i -> ee (but only the first `i' per word) | |
54 | o -> u | |
55 | u -> oo | |
56 | ||
57 | These translations always happen: | |
58 | v -> f | |
59 | V -> F | |
60 | w -> v | |
61 | W -> V | |
62 | an -> un | |
63 | An -> Un | |
64 | au -> oo | |
65 | Au -> Oo | |
66 | ||
67 | Any occurrence of "e" at the end of a word is changed to "e-a". | |
68 | ||
69 | Any occurrence of "e" and the beginning of a word is changed to "i". | |
70 | Same with capitals. | |
71 | ||
72 | Any occurrence of "the" is changed to "zee", any occurrence of | |
73 | "The", to "Zee". | |
74 | ||
75 | Any occurrence of "tion" in a word, to "shun". | |
76 | ||
77 | Any "th" at the end of a word is changed to "t". | |
78 | ||
79 | Any "en" at the end of a word is changed to "ee". | |
80 | ||
81 | Any "ow" at the end of a word is changed to "oo". | |
82 | ||
83 | And of course, after any `.', `?', or `!' that is at the end of a | |
84 | line, the Chef prints out a new line, and then the famous | |
85 | "Bork Bork Bork!", and then another newline. | |
86 | ||
87 | Known bugs in this implementation: | |
88 | - says "frunch", not "french". | |
89 | - still quite buggy in general. | |
90 | ||
91 | b1ff: | |
92 | Unlike the other filters, b1ff does not try to be an exact duplicate | |
93 | of its predecessor. | |
94 | ||
95 | After upper-casing everything, b1ff does some word and sub-word | |
96 | substitutions, most of them misspellings. | |
97 | ||
98 | B1ff also changes punctuation - All commas become periods; all | |
99 | semicolons, commas. Question and exclamation marks are changed to | |
100 | things like "!!!!1!" and "?!?!?!". It looks like the original filter | |
101 | decided how long a sequence to print based on the text input before | |
102 | the end of sentence. I took a simpler route and just randomized it. | |
103 | ||
104 | Written by Joey Hess <joey@kitenet.net> |