Syntax tier

Checks that measure sentences on a dependency parse: spaCy with its small English model, on CPU. Their findings are warnings: exact given the parse, but the parse is a model.

Shape: folder and its README.

They run weekly and on demand, not on every push. Install spaCy and its model with pip install -r checks/syntax/requirements.txt; without it the tier is skipped with a notice.

Contents

File Role Guarantee
clause_nesting.py Shallow nesting: no sentence centre-embeds a clause inside a centre-embedded clause Exact given the parse; the parse itself is a model.
dependency_length.py Short dependencies: no word sits more than max_distance words from the word it depends on Exact given the parse; the parse itself is a model.
parser.py The dependency parser the syntax checks share: spaCy's small English model, loaded once, on CPU
sentence_links.py Given before new: each sentence of a paragraph picks up something the one before it gave Heuristic, on top of a parse.
sentences_of.py The parsed paragraphs of the files in scope, shared by the syntax checks. Time O(words)

Example

python3 checks/run.py . --tiers syntax --judge none
judgment: 0 question(s), 0 answered in checks/judgments.toml, backend none
0 error(s), 0 warning(s); tiers run: syntax

Without spaCy, the same command says so rather than passing in silence:

notice   tier 'syntax' skipped: its library is not installed (see checks/README.md)
0 error(s), 0 warning(s); tiers run: none; skipped: syntax

See also

The other tiers, in checks; the principles these checks serve, in the sentence group.