Metadata-Version: 2.4
Name: slopometer
Version: 0.0.2
Summary: Score prose for simplicity and precision against plain-English reference rules
Author-email: Jeremy Howard <github@jhoward.fastmail.fm>
License: Apache-2.0
Project-URL: Repository, https://github.com/AnswerDotAI/slopometer
Project-URL: Documentation, https://AnswerDotAI.github.io/slopometer/
Keywords: nbdev
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: fastcore
Requires-Dist: spacy
Requires-Dist: mdhtml
Requires-Dist: warmpy>=0.1.0
Dynamic: license-file

# slopometer


<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->

`slopometer` measures prose against a range of reference-prose rules. The rules merge GOV.UK/GDS house style with the discipline of ASD-STE100, including 26 numbered tells, banned-word lists, and a reference register. It also has rules covering a range of best practices for clear technical communication, including paragraph length, referant tracking, and restatement.

`slopometer` is for anyone shipping READMEs, docstrings, PR text, or agent responses. It catches slop mechanically, in milliseconds, with no LLM in the loop. Every finding cites a rule, quotes a span, and carries a weight.

## Install

    pip install slopometer

The first score on a machine downloads spaCy’s `en_core_web_md` model (about 40MB, once) into `~/.cache/slopometer` and loads it by path. The model never enters a virtual environment. One copy serves every project. Environment syncs cannot remove it.

## Use

``` python
from slopometer.score import score_text, score_path
```

``` python
score_text("This section describes our approach. It isn't just a linter - it's a comprehensive paradigm for quality.")
```

    density 252.9 (weight 43 on 17 prose words), worst 10
    1: [10] notxbuty (tell 16, not-X-but-Y): "isn't just a"
    1: [10] splice (tell 1, splices): ' - '
    1: [10] banned: 'comprehensive' -> 'complete'
    1: [10] banned: 'paradigm'
    1: [3] throat_clearing (tell 13, throat-clearing): 'This section describes'

[`score_path`](https://AnswerDotAI.github.io/slopometer/score.html#score_path) does the same for a file, and its rows carry `lineno|hash|` addresses in the exhash format, ready for hash-verified editors. The command line wraps both:

    slopometer README.md
    git log -1 --format=%B | slopometer
    slopometer draft.md --threshold 10

The threshold turns the density into an exit code for CI. The command runs warm through `warmpy`. The first call loads the model in a background process. Later calls answer in milliseconds. After thirty idle minutes the process exits.

## What it checks, and what it cannot

The rules live in notebooks that teach each family beside its code. Each rule states its tell, shows a violating example, and shows the plain rewrite. The [lexicon notebook](https://AnswerDotAI.github.io/slopometer/lexicon.html) holds the word and phrase rules. The [syntax notebook](https://AnswerDotAI.github.io/slopometer/syntax.html) builds sentence rules on spaCy’s parse. The [para notebook](https://AnswerDotAI.github.io/slopometer/para.html) builds its rules on word vectors. The [score notebook](https://AnswerDotAI.github.io/slopometer/score.html) assembles the pipeline. A drift test asserts that every `write_docs` tell maps to a rule or to an explicit unscoreable registry. The meter and the style guide cannot drift apart silently.

A rule ships only when its false-positive rate on clean reference prose is near zero. The meter scores the style guide’s own clean passage at exactly 0.0. The score notebook measures the blind spot instead of hiding it: mechanically chopped prose passes every surface rule while staying opaque. Agent review (`check_docs`) and an optional, explicitly invoked [Pangram](https://www.pangram.com) check cover that residue. Vale, write-good, and proselint solve neighboring problems. The [lexicon notebook](https://AnswerDotAI.github.io/slopometer/lexicon.html) records what came from them. It also credits the [GOV.UK words-to-avoid list](https://www.gov.uk/guidance/style-guide/a-to-z-of-gov-uk-style#words-to-avoid) (OGL v3).
