1.\" $OpenBSD: spell.1,v 1.7 2005/07/05 15:01:12 jmc Exp $
2.\"
3.\" Copyright (C) 1985, 1993, 1994
4.\"	The Regents of the University of California.  All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice, this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\" 3. Neither the name of the University nor the names of its contributors
15.\"    may be used to endorse or promote products derived from this software
16.\"    without specific prior written permission.
17.\"
18.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
19.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
22.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28.\" SUCH DAMAGE.
29.\"
30.\" Copyright (C) Caldera International Inc.  2001-2002.
31.\" All rights reserved.
32.\"
33.\" Redistribution and use in source and binary forms, with or without
34.\" modification, are permitted provided that the following conditions
35.\" are met:
36.\" 1. Redistributions of source code and documentation must retain the above
37.\"    copyright notice, this list of conditions and the following disclaimer.
38.\" 2. Redistributions in binary form must reproduce the above copyright
39.\"    notice, this list of conditions and the following disclaimer in the
40.\"    documentation and/or other materials provided with the distribution.
41.\" 3. All advertising materials mentioning features or use of this software
42.\"    must display the following acknowledgement:
43.\"	This product includes software developed or owned by Caldera
44.\"	International, Inc.
45.\" 4. Neither the name of Caldera International, Inc. nor the names of other
46.\"    contributors may be used to endorse or promote products derived from
47.\"    this software without specific prior written permission.
48.\"
49.\" USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA
50.\" INTERNATIONAL, INC. AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR
51.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
52.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
53.\" IN NO EVENT SHALL CALDERA INTERNATIONAL, INC. BE LIABLE FOR ANY DIRECT,
54.\" INDIRECT INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
55.\" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
56.\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
57.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
58.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
59.\" IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
60.\" POSSIBILITY OF SUCH DAMAGE.
61.\"
62.\"	@(#)spell.1	8.2 (Berkeley) 4/18/94
63.\"
64.Dd April 18, 1994
65.Dt SPELL 1
66.Os
67.Sh NAME
68.Nm spell
69.Nd find spelling errors
70.Sh SYNOPSIS
71.Nm spell
72.Op Fl biltvx
73.Op Fl d Ar list
74.Op Fl h Ar spellhist
75.Oo
76.Fl m
77.Ar a | e | l | m | s
78.Oc
79.Op Fl s Ar stop
80.Op + Ns Ar extra_list
81.Op Ar
82.Sh DESCRIPTION
83.Nm spell
84collects words from the named documents and looks them up in a spelling list.
85Words that neither occur among nor are derivable (by applying certain
86inflections, prefixes or suffixes) from words in the spelling list
87are printed on the standard output.
88.Pp
89If no files are named, words are collected from the standard input.
90.Nm
91ignores most
92.Xr troff 1 ,
93.Xr tbl 1 ,
94.Xr eqn 1 ,
95and
96.Xr pic 1
97constructions.
98Copies of all output may be accumulated in the history file,
99if one is specified.
100.Pp
101By default,
102.Nm
103(like
104.Xr deroff 1 )
105follows chains of included files
106.Po
107.Dq .so
108and
109.Dq .nx
110commands
111.Pc .
112.Pp
113The default spelling list is based on Webster's Second International
114dictionary and should be fairly complete.
115Words that appear in the
116.Dq stop list
117are immediately flagged as misspellings, regardless of whether or not
118they exist in one of the word lists.
119This helps filter out misspellings (e.g. thier=thy\-y+ier)
120that would otherwise pass.
121Additionally, the
122.Pa british
123file is also used as a stop list unless the
124.Fl b
125option is specified.
126.Pp
127Site administrators may add words to the local word list,
128.Pa /usr/local/share/dict/words
129or the local stop list,
130.Pa /usr/local/share/dict/stop .
131.Pp
132All word (and stop) lists must be sorted in lexigraphical order
133with case folded.
134The simplest way to achieve this is to use
135.Dq sort -df .
136If the word files are incorrectly sorted,
137.Nm
138will not be able to operate correctly.
139.Pp
140The options are as follows:
141.Bl -tag -width Ds
142.It Fl b
143Check British spelling.
144Besides preferring
145.Em centre , colour , speciality , travelled ,
146etc., this option insists upon
147.Fl ise
148in words like
149.Em standardise ,
150Fowler and the OED to the contrary notwithstanding.
151In this mode, American variants of words are added to the stop list.
152.It Fl d Ar word_list
153Use the specified word list instead of the default system word list.
154The word list must be sorted as specified above.
155.It Fl h Ar spellhist
156Store misspelled words in the specified history file.
157The output of
158.Li who -m
159is appended to the history file after the list of misspelled words.
160.It Fl i
161Instruct
162.Xr deroff 1
163to ignore
164.Dq .so
165and
166.Dq .nx
167commands.
168.It Fl l
169Use
170.Xr delatex
171instead of
172.Xr deroff 1
173if it is present on the system.
174.It Fl m
175Enable support for common
176.Xr troff 1
177macro packages; this option is passed verbatim to
178.Xr deroff 1 .
179Refer to the
180.Fl m
181description in
182.Xr deroff 1
183for details.
184.It Fl s Ar stop_list
185Use the specified stop list instead of the default system stop list.
186The stop list must be sorted as specified above.
187.It Fl t
188Use
189.Xr detex
190instead of
191.Xr deroff 1
192if it is present on the system.
193.It Fl v
194Print all words not literally in the spelling list in addition to
195plausible derivations from spelling list words.
196.It Fl x
197Print every plausible stem, prefixed with
198.Sq = .
199.It + Ns Ar extra_list
200Use
201.Ar extra_list
202in addition to the default word list.
203The extra word list must be sorted as specified above.
204.El
205.Sh FILES
206.Bl -tag -width /usr/local/share/dict/wordsxx -compact
207.It Pa /usr/share/dict/words
208Default spelling list
209.It Pa /usr/share/dict/american
210American spelling of certain words
211.It Pa /usr/share/dict/british
212British spelling of certain words
213.It Pa /usr/share/dict/stop
214Default stop list.
215.It Pa /usr/local/share/dict/words
216Local spelling list (optional)
217.It Pa /usr/local/share/dict/stop
218Local stop list (optional)
219.It Pa /usr/libexec/spellprog
220Binary executed by the shell script
221.Pa /usr/bin/spell .
222.El
223.Sh SEE ALSO
224.Xr deroff 1 ,
225.Xr look 1 ,
226.Xr sed 1 ,
227.Xr sort 1 ,
228.Xr tee 1 ,
229.Xr troff 1
230.Sh HISTORY
231The
232.Nm spell
233command appeared in
234.At v6 .
235.Pp
236Unlike historic versions, the
237.Ox
238.Nm
239command does not use hashed word files.
240Instead, it uses lexigraphically sorted files and the same technique as
241.Xr look 1 .
242.Sh BUGS
243The spelling list lacks many technical terms; new installations will
244probably wish to monitor the output for several months to gather local
245additions.
246.Pp
247British spelling was done by an American.
248.Pp
249In
250.Fl x
251mode it would be nicer if the stems were grouped with the appropriate word.
252