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