PHONEWRD(1) PHONEWRD(1) NAME phonewrd - find words or phrases for phone numbers SYNOPSIS phonewrd [-n numerals allowed] [-s single letter words] [-q q mapping] [-z z mapping] [-d dictionary path] [-l word length] [-m numeral map] [-v] [-r] [-c] [-C] phone_number1[*...] [phone_number2[*...] ...] DESCRIPTION phonewrd finds words or phrases which match the input phone numbers. It uses the dictionary word list /usr/dict/words by default, ignoring one letter words (see -s). There are a wide variety of options available to allow various sorts of pattern matching. Words with apostrophes or other punctuation are acceptable. If more than one phone number is given, each number and its combinations are output. If the input phone number ends with one or more *, e.g. 555-1212**, then the output phrases can be up to that many characters longer that the input number. This usually yields a few extra phrases, and dialing those extra digits at the end normally doesn't cause problems. The input phone number can have letters in it, in which case that digit is forced to be that letter in any phrase. This can help pare down a long output list for a number. If the number is entirely letters, it is converted to numbers and output. If you don't have a dictionary on your system, a free set of dictionary files are available via FTP from prep.ai.mit.edu in /pub/gnu/ispell*.tar.z (you'll also need "gzip" in this same directory to uncompress this archive). phonewrd understands the "affix" format used for the dictionaries in ispell and expands words accordingly. If you can't get your hands on any dictionary files, look at the -r, -c, and (for the totally insane) -C options. These options do not need a dictionary (and so will do either very little or too much). Options -n numerals allowed This option allows phone digits to be replaced by numerals, up to the limit set. For example -n 2 means that any two digits of the phone number can be left as digits and not made a part of any word. This can help find phrases for phone numbers with poor letter combinations. Note that numerals that have no corresponding letters (i.e. 0 and 1 by default) do not count against this total, nor do one letter words set using -s. Default setting is 0. - 1 - Formatted: July 16, 1993 PHONEWRD(1) PHONEWRD(1) -s single letter words This option gives all allowed single letter words (including numeral "words", e.g. "I love U 2"). Normally dictionaries have all letters of the alphabet as being legal words, which gives a ton of useless phrases. By default the only allowed single letter words are "a", "i", and "o". As an example of how to change this, -s abcdgimoptuxy248 means that any of these single letters are now considered words. This can help find phrases for phone numbers with awful letter combinations and in general open up more possibilities. To have no single letter words at all, use -s =. -q mapping This option maps the letter q to the given numeral. For example, -q 0 means that phone numbers with 0's in them can have q's substituted for the 0's. This usually doesn't help much anyway, and it's up to you to remember that q == 0, but there you go. By default q is not mapped. -z mapping Amazingly similar to -q. This option maps the letter z to the given numeral. For example, -z 0 means that phone numbers with 0's in them can have z's substituted for the 0's. This usually doesn't help much anyway, and it's up to you to remember that z == 0, but there it is. By default z is not mapped. -d dictionary path This option allows alternate dictionaries to be used. For example, -d /users/fred/dict/star_trek_words will use (only) Fred's geek-speak dictionary. Default is /usr/dict/words (or whatever it is on your system), which is not used if any dictionary path is specified. Multiple dictionaries can be used by specifying multiple paths. For example, to use the geek speak dictionary along with the regular system dictionary, do: -d /users/fred/dict/star_trek_words -d /usr/dict/words A path of "." means use the default dictionary, so quicker yet is: -d . -d /users/fred/dict/star_trek_words In this way additional dictionaries can either replace or be added to the default. Note that phonewrd understands the "affix" format used for the dictionaries of GNU's ispell and expands words accordingly, so these can be used to add more words to the search. - 2 - Formatted: July 16, 1993 PHONEWRD(1) PHONEWRD(1) -l word length This option allows a minimum word length to be set. For example, -l 3 means no words shorter than 3 letters are used for building phrases. User defined single letter words (see -s) are not affected by this option. Single letter words from the dictionary are ignored no matter what the setting (since most dictionaries include exciting words like "h", "w" and so on). Default is 1. -m numeral map For those of you from a different planet, this will remap the letters to different numerals. For example, -m 2223334445556667.77888999. is the default setting, a normal telephone. The "." (or any other non-numeric value) means don't map the letter to any key. You get a banana for using -v with this command. -v Verbose option: words fitting into the various number slots are output and other warnings and whatnot are all output to stderr. This can help you "roll your own" if the program does not find anything to your liking. -r This option is for those without a dictionary. It simply outputs the letters possible for each digit in a column so that you can search for combinations more easily. No dictionary search is done, so none is needed. -c This option is also for those without a dictionary. It generates all permutations of letters and numerals valid for the input phone number and outputs these one per line. If you do: phonewrd -c 234-5678 > junk1 spell junk1 > junk2 diff junk1 junk2 | grep "<" you'll get any 7 letter words formed which pass the spell checker. It's a long shot, but you never know... -C This option is also for those without a dictionary and too much disk space and CPU time. It generates all permutations of letters and numerals valid for the input phone number and outputs these one per line, plus it makes all permutations of spacing for each of these permutations. 3^7 * 2^6 = 139968 phrases for a phone number without 0's and 1's. Then send each one through your spell checker and if any errors are found, discard it and go to the next. It will take awhile, but this is the price you pay for not having any dictionary available. - 3 - Formatted: July 16, 1993 PHONEWRD(1) PHONEWRD(1) EXAMPLES phonewrd 542-5968 gives the words: kick you lick you phonewrd 542-5968 -n 1 allows more slack, letting one character be a numeral: kick you lick you 5 gal you 5 Hal you which gives a little wider range of possibilities. phonewrd 5683968 -l 3 gives words 3 characters or longer: Jove you loud you love you phonewrd 486-9364 -s aio248 gives many combinations, but the -s aio248 allows the extra combination I 8 my dog phonewrd 787-3648* allows the extra combination strength as one * at the end means up to 1 additional character can be output at the end of the phrase. phonewrd 861-2076 doesn't yield much of anything, so setting 0 to o and 1 to i: phonewrd 86i-2o76 we get unicorn so un1c0rn fits the original phone number. Putting a letter in a phone number forces the use of that letter in that position. phonewrd -r 266-7883 yields a m m p t t d b n n r u u e c o o s v v f The letters for each numeral are output in columns and so can be more easily searched by hand for interesting phrases. Yes, I know you found bon stud in there, but what seven letter word can be found? If you find it, pat yourself on the cranium for having a brain and being able to quickly cull through the 2187 possibilities. phonewrd -c 2667883 will list all the possible combinations, e.g. - 4 - Formatted: July 16, 1993 PHONEWRD(1) PHONEWRD(1) ammpttd ammptte ammpttf ammptud ammptue ... which can then be run through a spell checker and so searched for seven letter words (see the -c option for how to do this). phonewrd 234-5678 -v will output all words which fit into the various places in the phone number. For example, one output entry is: Digit 5, length 3: opt which means that for the fifth digit of the number, all words of length three which fit (i.e. translate into "678" in this case) are displayed. TO BE DONE It would be cute to be able to map numerals to strings, e.g. 460-2253 with "0" mapped to "OPER" gives "inOPERable", or 434-4637 with "4" mapped to "for" gives "FOReigner". AUTHOR Eric Haines, erich@eye.com - 5 - Formatted: July 16, 1993