1 --- wordplay-7.22.orig/wordplay.c
2 +++ wordplay-7.22/wordplay.c
4 #define max(A, B) ((A) > (B) ? (A) : (B))
5 #define min(A, B) ((A) < (B) ? (A) : (B))
7 -#define DEFAULT_WORD_FILE "words721.txt"
8 +#define DEFAULT_WORD_FILE "/usr/share/wordplay/words721.txt"
9 #define WORDBLOCKSIZE 4096
10 #define MAX_WORD_LENGTH 128
11 #define SAFETY_ZONE MAX_WORD_LENGTH + 1
12 --- wordplay-7.22.orig/words721.txt
13 +++ wordplay-7.22/words721.txt
22 --- wordplay-7.22.orig/wordplay.1
23 +++ wordplay-7.22/wordplay.1
25 +.TH FOO 1 "DECEMBER 1996" "" "Commands"
27 +wordplay \- anagram finder
29 +.B wordplay string [\-slxavnmd] [\-w word] [\-f wordfile]
32 +is an anagram finder. What is an anagram? Well, let's turn to
33 +Merriam-Webster's Collegiate Dictionary, Tenth Edition:
35 +a word or phrase made by transposing the letters of another word or phrase.
37 +Each letter in the anagram must appear with the same frequency as in the
40 +For example, the letters in the word "stop" can be rearranged to spell
41 +"tops" or "pots" or "sotp". "sotp" is not a word and is not of interest
42 +when generating anagrams. "stop" has four letters, so there are 24 ways
43 +to rearrange its letters. However, very few of the rearrangements actually
46 +Wordplay, by using a list of words, takes a specified string of letters and
47 +uses the list of words to find anagrams of the string.
49 +By the way, "Wordplay" anagrams to "Rowdy Pal", and the program really can
50 +live up to that particular anagram. I have been able to come up with
51 +anagrams of most of my coworkers' names that are humorous, descriptive,
52 +satirical, or, occasionally, quite vulgar.
55 +String to be anagrammed. This should be seen to the program \fBas a
56 +single argument\fP. If you feel you must put spaces in the string, under
57 +UNIX, you will have to put backslashes in front of the spaces or just put
58 +the entire string in double quotes. Just leave the spaces out because the
59 +program throws them out anyway.
61 +Silent operation. If this option is used, the header and line
62 +numbers are not printed. This is useful if you want the output to
63 +contain only the anagrams. Use this option with the l (and x) option
64 +to generate a wordlist which can be piped or redirected.
65 +This option does not suppress error messages that are printed to
66 +stderr. Finding zero anagrams is not an error.
68 +Print list of candidate words before anagramming. This is the list of
69 +words that can be spelled with the letters from the specified string,
70 +with no letters being used more often that they appear in the input
73 +Do not perform anagramming. Use with l if you just want the
74 +candidate word list without anagrams.
76 +Allow anagrams containing two or more occurrences of a word.
78 +Consider strings with no vowels as candidate words and do not give
79 +up when there are no vowels remaining after extractions.
81 +Limit candidate word length to a maximum number of letters.
82 +Follow by an integer. m12 means limit words to 12 letters.
83 +m5 means limit them to 5 letters.
85 +Limit candidate word length to a minimum number of letters.
86 +Follow by an integer. n2 means limit words to 2 letters.
87 +n11 means limit them to 11 letters.
89 +Limit number of words in anagrams to a maximum number.
90 +Follow by an integer. d3 means no anagrams should contain more
91 +than 3 words. d12 means limit anagrams to 12 words. This is
92 +currently the option that I recommend to limit output, since
93 +an optimization has been added to speed execution in some cases
94 +when this option is used.
96 +Specify a word which should appear in all anagrams. This is useful
97 +if you already have a word in mind that you want in the anagrams.
98 +This option should be specified at the end of the command, followed
99 +by a space and the word to use.
101 +Specify which word list to use. See example! This option should
102 +be specified at the end of the command, followed by a space and the
103 +alternate wordfile name. This is useful if you have other word lists
104 +to try or if you are interested in making your own customized word
106 +New feature: Use a hyphen as the filename if the wordlist should
109 +.IP "wordplay persiangulf"
110 +Anagram the string "persiangulf" .
111 +.IP "wordplay anagramming -lx"
112 +Print the list of words from the wordlist that can be spelled by using
113 +the letters from the word "anagramming". A letter may not be used more
114 +often than the number of times it occurs in the word "anagramming".
115 +No anagrams are generated.
116 +.IP "wordplay tomservocrow -n3m8"
117 +Anagram the string "tomservocrow" . Do not use words shorter than
118 +3 letters or longer than 8 letters.
119 +.IP "wordplay persiangulf -ld3m10 -f /usr/share/dict/words"
120 +Print the candidate words for the string "persiangulf".
121 +Print anagrams containing up to 3 words, without considering any
122 +words longer than 10 characters. Use the file "/usr/share/dict/words"
123 +rather than "words721.txt".
124 +.IP "wordplay soylentgreen -n3w stolen -f w2"
125 +Print anagrams of "soylentgreen" containing the word "stolen" and
126 +use the file "w2" as the wordlist file. Discard candidate words
127 +shorter than 3 characters.
128 +.IP "wordplay university -slx"
129 +Print the candidate word list for the string "university". The
130 +output will consist of just the words. This output is more useful
131 +for redirecting to a file or for piping to another program.
132 +.IP "wordplay trymeout -s"
133 +Anagram the string "trymeout" and print the anagrams with no line
134 +numbers. The header will not be printed. This is useful for piping
135 +the output to another process (or saving it to a file to be used
136 +by another program) without having to parse the output to remove the
138 +.IP "wordplay trymeout -v"
139 +Anagram "trymeout" as usual, but in case vowel-free strings are in
140 +the wordlist, consider them as possible candidate words.
141 +.IP "cat wordlist1 wordlist2 wordlist3 | sort -u | wordplay trymeout -f -"
142 +Anagram "trymeout" and read the wordlist from stdin, so that, in
143 +this case, the three wordlists "wordlist1", "wordlist2",
144 +and "wordlist3" will be concatenated and piped into
146 +as the wordlist. The "sort -u" is there to remove duplicate words
147 +from the combined wordlist.
149 +If the option specifiers are combined, as in "an7m7d5f" or "d3n5f", the f
150 +should come last, followed by a space and the word list file.
152 +The "w" option is used in the same manner.
154 +Limit the number of words to consider, if desired, using the n and m
155 +options, or better yet, use the d option to limit depth, when anagramming
156 +certain time-consuming strings. The program is currently optimized to speed
157 +execution in some cases when the d option is used.
159 +It is highly recommended that the "words721.txt" file distributed with the program be
160 +used, since many nonsense two and three-letter combinations that are not
161 +words have been eliminated. This makes the quality of the output slightly
162 +better and speeds execution of the program a slight bit. Any word list may
163 +be used, as long as there is one word per line. Feel free to create your
164 +own custom word list and use it instead. The word list does not have to be
165 +sorted in any particular way.
167 +.I /usr/share/games/wordplay/words721.txt
169 +Default word list file.
172 +This program was written for fun and is free. Distribute it as you please,
173 +but please distribute the entire package, with the original words721.txt and
174 +the readme file. If you modify the code, please mention my name in it as
175 +the original author. Please send me a copy of improvements you make, because I
176 +may include them in a future version.
178 +Wordplay was written by Evans A Criswell <criswell@cs.uah.edu>
180 +This man page was written by Joey Hess <joeyh@debian.org>