go

command module
v0.0.0-...-2f390ff Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 24, 2026 License: MIT Imports: 11 Imported by: 0

README

rhetorlint (Go)

A third reference engine for the RhetorLint spec, in Go. Reads the same rule pack (packages/rules-en/rules.json) and reproduces the same conformance corpus as the JavaScript and Python engines, value for value over its current ASCII scope.

Standard library only. No third-party dependencies.

Run

echo "We take your privacy extremely seriously." | go -C impl/go run .

Conformance

go -C impl/go test ./...  # 31/31 ASCII cases identical to the JS ground truth

The RE2 lesson

Go's regexp is RE2, which — by design — has no lookahead. The JS/Python engines use one: (?!\s+by\b), to not flag "the report was written by the committee" as an agent-hiding passive (the agent is named). Go can't express that in the pattern, so this engine matches the be-verb + participle without the lookahead, then checks in code whether " by <agent>" follows and skips it if so. Same result, different mechanism — which is exactly the kind of thing a conformance suite is for: it proves the output is identical even when the implementation can't be.

Offsets here are byte offsets (Go strings are UTF-8). They equal the JS (UTF-16) and Python (code-point) offsets for ASCII, which is the corpus's current conformance scope. Non-ASCII offsets and matching are not portable; see ../../conformance/README.md.

Guarantees (identical to the other engines)

Marks point at visible text; no person-reading; no truth-score; no fabricated rewrite (rewrite is null); confidence is a heuristic language-pattern likelihood, never a probability of deception.

Documentation

Overview

Command rhetorlint is a Go reference implementation of the RhetorLint spec.

A third engine, in a third language, that reads the same rule pack (packages/rules-en/rules.json) and reproduces the same conformance corpus values as the JavaScript and Python engines over its current ASCII scope. Its only reason to exist is to prove the taxonomy is portable.

Note on offsets: Go strings are byte sequences, so positions are byte offsets. For ASCII text these equal the JS (UTF-16) and Python (code-point) offsets; the conformance corpus is ASCII. See conformance/README.md for the astral-character caveat.

Zero third-party dependencies (standard library only). It marks tells in the words; it does not read the person, detect lies, or judge factual truth.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL