updated on Tue Jan 10 08:08:34 UTC 2012
[aur-mirror.git] / wordplay / wordplay_7.22-1.diff
blobf45061f8865dc00f83b348c1d0f3bcf5ee5daee3
1 --- wordplay-7.22.orig/wordplay.c
2 +++ wordplay-7.22/wordplay.c
3 @@ -142,7 +142,7 @@
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
14 @@ -7172,6 +7172,7 @@
15 DUCTILE
16 DUCTWORK
17 DUD
18 +DUDE
19 DUDLEY
20 DUE
21 DUEL
22 --- wordplay-7.22.orig/wordplay.1
23 +++ wordplay-7.22/wordplay.1
24 @@ -0,0 +1,156 @@
25 +.TH FOO 1 "DECEMBER 1996" "" "Commands"
26 +.SH NAME
27 +wordplay \- anagram finder
28 +.SH SYNOPSIS
29 +.B wordplay string [\-slxavnmd] [\-w word] [\-f wordfile]
30 +.SH DESCRIPTION
31 +.B wordplay
32 +is an anagram finder. What is an anagram? Well, let's turn to
33 +Merriam-Webster's Collegiate Dictionary, Tenth Edition:
34 +.IP anagram:
35 +a word or phrase made by transposing the letters of another word or phrase.
36 +.PP
37 +Each letter in the anagram must appear with the same frequency as in the
38 +original string.
39 +.PP
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
44 +spell words.
45 +.PP
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.
48 +.PP
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.
53 +.SH OPTIONS
54 +.IP string
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.
60 +.IP -s
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.
67 +.IP -l
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
71 +string.
72 +.IP -x
73 +Do not perform anagramming. Use with l if you just want the
74 +candidate word list without anagrams.
75 +.IP -a
76 +Allow anagrams containing two or more occurrences of a word.
77 +.IP -v
78 +Consider strings with no vowels as candidate words and do not give
79 +up when there are no vowels remaining after extractions.
80 +.IP -m
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.
84 +.IP -n
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.
88 +.IP -d
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.
95 +.IP -w
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.
100 +.IP -f
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
105 +list.
106 +New feature: Use a hyphen as the filename if the wordlist should
107 +be read from stdin.
108 +.SH EXAMPLES
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
137 +numbers and header.
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
145 +.B wordplay
146 +as the wordlist. The "sort -u" is there to remove duplicate words
147 +from the combined wordlist.
148 +.SH NOTES
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.
151 +.PP
152 +The "w" option is used in the same manner.
153 +.PP
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.
158 +.PP
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.
166 +.SH FILES
167 +.I /usr/share/games/wordplay/words721.txt
168 +.RS
169 +Default word list file.
170 +.RE
171 +.SH DISTRIBUTION
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.
177 +.SH AUTHOR
178 +Wordplay was written by Evans A Criswell <criswell@cs.uah.edu>
179 +.PP
180 +This man page was written by Joey Hess <joeyh@debian.org>