sgml-spell-checker(1)
β¨ sgml-spell-checker(1) β¨
okay bestie, welcome to the SGML section of the manual, and to the little tool called sgml-spell-checker π
πΈ NAME πΈ
sgml-spell-checker β the SGML spell checker, literally doing the absolute most so you don't have to π
π¦ SYNOPSIS π¦
nsgmls -l yourdoc.sgml | sgml-spell-checker [option] ...
π DESCRIPTION π
so sgml-spell-checker is this iconic little tool you can use to automatically spell-check your SGML documents, no cap π and here's the tea on why it eats: unlike some other SGML-aware spell checkers, it scans your documents in the form in which the SGML parser actually sees it. which means β and hear me out β it is not line-based, system entities are resolved, marked sections are treated appropriately, etc. etc. it's giving thorough. it's giving correct. periodt β¨
also? this tool can be made aware of particular DTDs, in the sense that it knows not to spell-check the content of elements that do not represent human-language text, such as <programlisting> in DocBook π like, it knows that's not prose, it's code, and it's respectfully not going to yell at you about it. an exclusion list for the DocBook DTD is included, and others can be added trivially π
the input to sgml-spell-checker is the text representation of your SGML document's Element Structure Information Set as generated by nsgmls (from SP or OpenSP; sometimes installed under the name onsgmls). in other words, you need to pipe the output of nsgmls into sgml-spell-checker as shown in the synopsis π₯. provide to nsgmls the options you need, such as -c to search more catalogs, -i to include a marked section, or more source files. and bestie, do not forget the -l option, or you won't get any file or line references for the misspellings π that's the whole point fr fr.
the second part of the pipe takes a couple of options; see below. note that if the language of the document does not match your system's locale settings, you need to use the --language option β
the output of sgml-spell-checker is a list of the words that are misspelled (in the opinion of aspell), together with file name and line number. and okay, tiny warning here: the line number designates where the element that contains the word started, not where the word actually is π so most likely you will have to search a few lines below the indicated location. not a bug, just the vibe. iykyk.
π OPTIONS π
--debugβ Debug mode. generates lots of output that is genuinely not of interest to the normal user π like, it's fine, it's just not for you unless you're debugging.--language=languageβ sets the language of the document. (the format depends on the aspell installation, but something likeenoren_USshould work.) by default the language is taken from the system locale settings π--suggestionsβ shows correction suggestions for misspelled words. so helpful, so kind π«Ά--dictionary=fileβ uses an additional aspell dictionary file. this option may be used multiple times π stack those dictionaries bestie.--dtd=dtdβ uses the exclusion list for the specified DTD (e.g.,docbook) π¦--helpβ shows a brief help, then exits. short, sweet, out β¨
π EXAMPLES π
nsgmls -l -D . mydoc.sgml | \
sgml-spell-checker --language=en --dtd=docbook \
--dictionary=mydict1.aspell --dictionary=mydict2.aspell
(you can enter this command all on one line without the backslashes, or on several lines with the backslashes π either way is valid, do whatever feels right.)
π§ NOTES π§
read the aspell documentation about how to set up the appropriate dictionaries π and in case you're having trouble interpreting the aspell documentation, here's how to make an aspell dictionary file from a flat word list:
rm -f mydict1.aspell # aspell won't overwrite existing files
aspell --language-tag=xx create master ./mydict1.aspell < mywordlist.txt
watch the slashes π aspell likes to see a slash in the name or it will search some default location. the slash is not optional, it's the main character.
π BUGS π
this program should be able to identify the language from the document (e.g., <book lang="de">), but aspell doesn't handle changing the language on the fly π so, yeah. it's not sgml-spell-checker's fault, it's just how it is.
π AUTHOR π
Peter Eisentraut (peter_e@gmx.net) β thank you for this gift π«Ά
and that's the whole page bestie!! πβ¨
this was the SGML spell checker manual, dated 2004-09-19, version line sgml-spell-checker(1) β go forth, pipe responsibly, and may all your misspellings be found πΈπ¦π
π¦ where this page comes from
- debian bookworm: sgml-spell-checker 0.0.20040919-5 Β· MIT
- debian trixie: sgml-spell-checker 0.0.20040919-5 Β· MIT
- ubuntu jammy: sgml-spell-checker 0.0.20040919-5 Β· MIT
- ubuntu noble: sgml-spell-checker 0.0.20040919-5 Β· MIT
- ubuntu resolute: sgml-spell-checker 0.0.20040919-5build1 Β· MIT
- ubuntu stonking: sgml-spell-checker 0.0.20040919-5build1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms