1.\" $NetBSD: spell.1,v 1.4 2005/12/04 09:14:58 wiz Exp $ 2.\" 3.\" derived from: OpenBSD: spell.1,v 1.6 2003/06/10 09:12:11 jmc Exp 4.\" 5.\" Copyright (C) 1985, 1993, 1994 6.\" The Regents of the University of California. All rights reserved. 7.\" 8.\" Redistribution and use in source and binary forms, with or without 9.\" modification, are permitted provided that the following conditions 10.\" are met: 11.\" 1. Redistributions of source code must retain the above copyright 12.\" notice, this list of conditions and the following disclaimer. 13.\" 2. Redistributions in binary form must reproduce the above copyright 14.\" notice, this list of conditions and the following disclaimer in the 15.\" documentation and/or other materials provided with the distribution. 16.\" 3. Neither the name of the University nor the names of its contributors 17.\" may be used to endorse or promote products derived from this software 18.\" without specific prior written permission. 19.\" 20.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 21.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30.\" SUCH DAMAGE. 31.\" 32.\" Copyright (C) Caldera International Inc. 2001-2002. 33.\" All rights reserved. 34.\" 35.\" Redistribution and use in source and binary forms, with or without 36.\" modification, are permitted provided that the following conditions 37.\" are met: 38.\" 1. Redistributions of source code and documentation must retain the above 39.\" copyright notice, this list of conditions and the following disclaimer. 40.\" 2. Redistributions in binary form must reproduce the above copyright 41.\" notice, this list of conditions and the following disclaimer in the 42.\" documentation and/or other materials provided with the distribution. 43.\" 3. All advertising materials mentioning features or use of this software 44.\" must display the following acknowledgement: 45.\" This product includes software developed or owned by Caldera 46.\" International, Inc. 47.\" 4. Neither the name of Caldera International, Inc. nor the names of other 48.\" contributors may be used to endorse or promote products derived from 49.\" this software without specific prior written permission. 50.\" 51.\" USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA 52.\" INTERNATIONAL, INC. AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR 53.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 54.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 55.\" IN NO EVENT SHALL CALDERA INTERNATIONAL, INC. BE LIABLE FOR ANY DIRECT, 56.\" INDIRECT INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 57.\" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 58.\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 59.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 60.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 61.\" IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 62.\" POSSIBILITY OF SUCH DAMAGE. 63.\" 64.\" @(#)spell.1 8.2 (Berkeley) 4/18/94 65.\" 66.Dd April 18, 1994 67.Dt SPELL 1 68.Os 69.Sh NAME 70.Nm spell 71.Nd find spelling errors 72.Sh SYNOPSIS 73.Nm spell 74.Op Fl biltvx 75.Op Fl d Ar list 76.Op Fl h Ar spellhist 77.Op Fl m Ar a | e | l | m | s 78.Op Fl s Ar stop 79.Op + Ns Ar extra_list 80.Op Ar 81.Sh DESCRIPTION 82.Nm spell 83collects words from the named documents and looks them up in a 84spelling list. 85Words that neither occur among nor are derivable (by applying 86certain inflections, prefixes or suffixes) from words in the spelling 87list are 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 lexicographical 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 152list. 153.It Fl d Ar word_list 154Use the specified word list instead of the default system word 155list. 156The word list must be sorted as specified above. 157.It Fl h Ar spellhist 158Store misspelled words in the specified history file. 159The output of 160.Li who -m 161is appended to the history file after the list of misspelled words. 162.It Fl i 163Instruct 164.Xr deroff 1 165to ignore 166.Dq .so 167and 168.Dq .nx 169commands. 170.It Fl l 171Use 172.Ic delatex 173instead of 174.Xr deroff 1 175if it is present on the system. 176.It Fl m 177Enable support for common 178.Xr troff 1 179macro packages; this option is passed verbatim to 180.Xr deroff 1 . 181Refer to the 182.Fl -m 183description in 184.Xr deroff 1 185for details. 186.It Fl s Ar stop_list 187Use the specified stop list instead of the default system stop 188list. 189The stop list must be sorted as specified above. 190.It Fl t 191Use 192.Ic detex 193instead of 194.Xr deroff 1 195if it is present on the system. 196.It Fl v 197Print all words not literally in the spelling list in addition to 198plausible derivations from spelling list words. 199.It Fl x 200Print every plausible stem, prefixed with 201.Sq = . 202.It + Ns Ar extra_list 203Use 204.Ar extra_list 205in addition to the default word list. 206The extra word list must be sorted as specified above. 207.El 208.Sh FILES 209.Bl -tag -width /usr/local/share/dict/wordsxx -compact 210.It Pa /usr/share/dict/words 211Default spelling list 212.It Pa /usr/share/dict/american 213American spelling of certain words 214.It Pa /usr/share/dict/british 215British spelling of certain words 216.It Pa /usr/share/dict/stop 217Default stop list. 218.It Pa /usr/local/share/dict/words 219Local spelling list (optional) 220.It Pa /usr/local/share/dict/stop 221Local stop list (optional) 222.It Pa /usr/libexec/spellprog 223Binary executed by the shell script 224.Pa /usr/bin/spell . 225.El 226.Sh SEE ALSO 227.Xr deroff 1 , 228.Xr look 1 , 229.Xr sed 1 , 230.Xr sort 1 , 231.Xr tee 1 , 232.Xr troff 1 233.Sh HISTORY 234The 235.Nm spell 236command appeared in 237.At v6 . 238.Pp 239Unlike historic versions, the 240.Nx 241.Nm 242command does not use hashed word files. 243Instead, it uses lexicographically sorted files and the same technique 244as 245.Xr look 1 . 246.Sh BUGS 247The spelling list lacks many technical terms; new installations 248will probably wish to monitor the output for several months to 249gather local additions. 250.Pp 251British spelling was done by an American. 252.Pp 253In 254.Fl x 255mode it would be nicer if the stems were grouped with the appropriate 256word. 257