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