- TypeScript 82.2%
- JavaScript 15.3%
- HTML 1.4%
- Python 1.1%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
The tell is the SETUP, not what fills it. "3 rules." is not a sentence; it
names a thing and stops, and the next beat takes the thing away before the
reader has been told anything about it. Two beats in there is still nothing
to agree or disagree with. A count is only the most common thing people put
in that slot.
Keying on the number was reading the filler for the form. Dropping the
quantity requirement takes the rule from 5 of 14 collected specimens to
14 of 14 (18 of 18 with the fixtures folded in), and the ones it had been
missing are the same formula with a noun phrase instead:
"A new framework. And nobody asked for it."
"Beautiful documentation. None of it true."
"Endless meetings. No decisions."
"An enormous backlog. Never groomed."
"First rule. None you set." moves from negative to positive on the same
reasoning: the ordinal argument was an artifact of the quantity framing.
The count survives only as a label in the message, because "a bare count"
is worth naming when it is there.
Precision held while the setup generalized, and three tests were needed to
keep it:
-ed evidence "He counted them twice. Sixteen, not fifteen."
irregular pasts "The old house stood empty. Nothing moved inside."
auxiliary + not "Do not rely on it." negates a VERB — the setup is
still standing. This was a live false positive on a
markdown table cell in RESEARCH.md.
0 hits across every repo doc, Hemingway, and both LinkedIn controls.
|
||
| .eval | ||
| .github/workflows | ||
| docs | ||
| parser-export | ||
| public/models | ||
| scripts | ||
| src | ||
| tools | ||
| .gitignore | ||
| DESIGN.md | ||
| destink.html | ||
| drag.html | ||
| free.html | ||
| game.html | ||
| index.html | ||
| LICENSE | ||
| package-lock.json | ||
| package.json | ||
| play.html | ||
| README.md | ||
| RESEARCH.md | ||
| ROADMAP.md | ||
| tsconfig.json | ||
| vite.config.ts | ||
Reed-Kellogg Sentence Diagram Engine
Automatic Reed-Kellogg sentence diagramming in the browser. Type a sentence; a neural constituency parser (benepar, run client-side via ONNX Runtime Web) produces a parse, which is lowered to a grammatical IR and laid out as a Reed-Kellogg diagram. No server, no install.
Why this exists
Reed-Kellogg diagrams are the traditional pedagogical sentence diagram: a horizontal baseline, a
vertical bar splitting subject and predicate, modifiers on slanted lines below the words they
modify. Existing tools split into two camps — manual editors that render nothing automatically,
and NLP parsers that stop at dependency or constituency trees. The one tool that ever generated
Reed-Kellogg diagrams from arbitrary text automatically (1AiWay) runs on Silverlight and no longer
works in a modern browser. This project fills that gap: automatic parse → Reed-Kellogg, entirely
client-side. RESEARCH.md documents the landscape survey behind that claim.
Status
- Automatic constituency-parse → Reed-Kellogg, in-browser, with a rule-based fallback parser.
- 90/90 clean on a battery of sentences drawn from real diagramming lessons — zero dropped words, zero label/line collisions — across imperatives, questions, relative / noun / adverb clauses, gerund / infinitive / participle verbals, appositives, correlatives, indirect and objective complements, causative small clauses, and absolute phrases.
- Ambiguous sentences surface alternative parses instead of guessing.
- SVG export.
- 216 tests; a geometric collision detector gates layout correctness.
Not yet: in-place correction of a wrong diagram, export formats beyond SVG, and validation on
non-pedagogical prose. See ROADMAP.md.
Run
npm install
npm run dev
The neural parser weights (~72 MB — benepar exported to int8 ONNX) are a build artifact and are
not committed. Regenerate them with the scripts in parser-export/ (Python + benepar). Without
them, the app falls back to a pure-TypeScript rule-based parser.
Build and test
npm run build # static site into dist/
npm test # unit + collision-regression suites
Architecture
text → neural constituency parse (src/parser/) → Clause IR (src/lower.ts) → footprint layout
(src/layout.ts) → Scene → Canvas / WebGPU or SVG renderer. The parse → IR lowering is the piece
no existing tool provides. DESIGN.md covers the architecture; RESEARCH.md the motivating gap.
De-stink
destink.html is a second, thin app on the same engine: a deterministic linter for AI-writing
tropes, built off the same constituency parse and Clause IR rather than a second model. It covers
the syntactic, lexical, formatting, and measurable-discourse tiers (repetition, anaphora, dilution)
with located findings, a stink score, and mechanical fixes limited to deleting, moving, or
lightly repairing the author's own words; semantic tropes (stakes inflation as tone, false
vulnerability, dead metaphors beyond lemma counting) are out of scope for a parser and are not
claimed. See docs/DESTINK.md for the architecture and scripts/destink-score.mjs for the
no-browser CLI.
License
MIT. See LICENSE.