selfdoc v0.37.1 /selfdoc.spell_corpus
On this page

Reference for selfdoc.spell_corpus: the read-only sweep that runs the SPELL001 spelling engine over every sibling selfdoc project and reports each one's unknown words.

#selfdoc.spell_corpus

#selfdoc.spell_corpus

The corpus-wide spelling run: the same engine, every sibling project.

selfdoc check spell-checks the project it is run in. This runs the identical engine (selfdoc_core.spelling) over every selfdoc project that lives beside it, which is how the shared accept list gets populated: one sweep surfaces the technical vocabulary the whole fleet uses, and the terms that are genuine get added once, for everyone.

Strictly read-only over the projects it visits. Directives are not resolved -- resolution runs a project's extractors over its source, and a survey has no business doing that in someone else's repository -- so what is scanned is the raw Markdown body of every docs template and every post. Posts are read straight off disk rather than through selfblog's discovery, which means drafts are surveyed too: a draft's prose is still prose, and a term it introduces belongs on the accept list before the draft ships. A project whose config cannot be loaded is reported and skipped, never fatal.

#ProjectSpellReport

What the sweep found in one project.

#unique_words

python
def unique_words(self) -> list[tuple[str, int]]

Unknown words with their occurrence counts, commonest first.

#scan_project

python
def scan_project(project, vocab, accepted) -> ProjectSpellReport

Spell-check one project's docs tree and its posts.

Args:

  • project: A :class:selfdoc_core.fleet.FleetProject.
  • vocab: The word list to accept against.
  • accepted: The accept list.

Returns:

  • A report; error is set instead of results when the project could
  • not be read.

#run_spell_corpus

python
def run_spell_corpus(root, format='text', detail=True) -> int

Sweep every selfdoc project under root and print the findings.

Args:

  • root: Directory whose immediate subdirectories are searched for

selfdoc.json.

  • format: "text" for the table, "json" for the machine shape.
  • detail: Whether the text output lists each project's unknown words

with a first location.

Returns:

  • 1 when any unknown word was found (a misspelling is an error, and
  • the accept list is the sanctioned answer for a genuine term), 0 on
  • a clean sweep. A project that could not be read is reported but
  • does not by itself fail the sweep.
Search