Earlier today I was talking to my friend, Pam, on line and she seemed to be speaking rather funny.
me: How are you?
Pamela: well, apart from not hav1ng some very important letters not working...
me: You're 'i' key is broken?
Pamela: 3 keys
f, r, i
Pam has app't 2moro to see Mac "gen1uses"
me: How did it break? Mysteriously?
Pamela: not so Mysteriously.
1 sp1lled a small amount of H20
Intermittently a few of her keys would not work so she was resorting to l33t speak, cutting and pasting my own words back to me, using chemical formula abbreviations, or simply referring to herself in the third person. So I did what any good, overly nerdy friend would do in that situation.
grep -vi "[fri]" /usr/dict/words | mutt -s "Here's a list of words that don't use F, R, or I" [Pam's email address]
But as you can probably imagine, a list of all of the words in the English language that don't use the letters F, R, or I isn't all that useful. For starters one would have to search the entire list of words and the definitions aren't even there.
I simply had to do more to help the poor girl, so I helped how any good, super geeky friend would help. I made a small program that uses a machine readable thesaurus from the Moby project to accept a sentence that you want to type, as well as a list of keys that are broken. The program searches the sentence for any uses of the broken keys and swaps them out for suitable synonyms that don't also use the broken keys. In the event there are no suitable synonmys, the word gets printed out with square brackets. I call it PamFRI.
If you're wondering what the above paragraph looks like without the letter's F, R, or I:
Ego absolutely had to do on and on to help the debased dame, so psyche helped how any good, hot geeky bosom buddy would help. Monad made a small agenda that uses a jalopy plumbable cache ex the Moby lay plans to accept a sentence that you want to type, as well as a levy about jolty keys. The keynote speech looks down the sentence so as to any uses about the wobbly keys and swaps them out because plenty good enough synonyms that don't also use the quelled keys. Gangplank the event no seasonable synonmys can be etch, the vow gets typeset out amongst yes-man [brackets]. One and only call the goods [PamFRI].
(planet "csv.ss" ("neil" "csv.plt" 1 1))
(let ([table (make-hash-table 'equal)]
'((separator-chars . (#\,))
(strip-leading-whitespace? . #t)
(strip-trailing-whitespace? . #t)))])
(let loop ([line (get-line)])
(unless (empty? line)
(let ([word (first line)])
(hash-table-put! table word (rest line))
(define (suggest badchars sentence)
(if ((typeable? badchars) aword)
(replacement badchars aword)))))
(define ((typeable? badchars) aword)
"(?i:[" (list->string badchars) "])"))
(define (replacement badchars aword)
thesaurus aword (lambda () empty))]
(filter (typeable? badchars) synonyms)])
(if (empty? replacements)
(string-append "[" aword "]")
(random (length replacements))))))
You call the program like this:
> (suggest '(#\h) "hello my name is")
"salutation my name is"
> (suggest '(#\h #\n) "hello my name is")
"kiss my itemize is"
> (suggest '(#\i) "I like the program very much")
"superego respect the program very much"
So if you're a clumsy, water drinking, Apple computing, debased dame, fear not. Help is on the way. You can download the program here in a zip format complete with the thesaurus. The program requires Dr. Scheme to be opened which is availible for Linux, Mac, and Windows.
By the way, I fully intend to continue calling them 'yes-man brackets'.