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 like en or en_US should 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 πŸŒΈπŸ¦‹πŸ’œ