prose

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package prose holds writing to the floor readers expect from a person: no stock phrases of generated copy, none of the structural habits current models have (correcting claims nobody made, announcing instead of saying, recap endings, label-colon bullets, pet words), concrete names and numbers, paragraphs and sentences shaped like human writing, and an estimate of whether AI-text detectors would flag it (package aitext).

The lexicon, thresholds and detector come from lfm, which calibrated them on public-domain books, modern essays, edited guides and current model output in English and German; other languages get the language-agnostic checks. Everything runs in a few milliseconds for a newsletter issue.

Index

Constants

View Source
const (
	RuleMachine     = "prose.machine"
	RuleTells       = "prose.tells"
	RuleCorrective  = "prose.corrective"
	RuleSignpost    = "prose.signpost"
	RulePets        = "prose.pets"
	RuleBold        = "prose.bold"
	RuleLabels      = "prose.labels"
	RuleConnectors  = "prose.connectors"
	RuleParticiples = "prose.participles"
	RuleHedges      = "prose.hedges"
	RuleStockNames  = "prose.stocknames"
	RuleSources     = "prose.sources"
	RuleArtifacts   = "prose.artifacts"
	RuleOpening     = "prose.opening"
	RuleEnding      = "prose.ending"
	RuleSpecifics   = "prose.specifics"
	RuleNominal     = "prose.nominal"
	RuleParagraphs  = "prose.paragraphs"
	RuleFragments   = "prose.fragments"
	RuleReadability = "prose.readability"
	RuleDashes      = "prose.dashes"
	RulePlaceholder = "prose.placeholder"
	RuleRepeat      = "prose.repeat"
	RuleRhythm      = "prose.rhythm"
	RuleOpeners     = "prose.openers"
	RuleQuestions   = "prose.questions"
)

Rule IDs.

Variables

This section is empty.

Functions

func Check

func Check(t Text) []finding.Finding

Check reports what in the text falls below the floor. Every finding is a warning, except template filler.

func MachineHint

func MachineHint(r aitext.Result) string

MachineHint is the advice for a text detectors would flag: what to change for each habit measured, and never to game the detector.

func MachineMessage

func MachineMessage(what string, r aitext.Result) string

MachineMessage says why detectors would flag a text.

func Placeholder

func Placeholder(text string) string

Placeholder returns template filler found in text (lorem ipsum, TODO, "your … here", [insert …]), or "".

func ProseDashes

func ProseDashes(s string) int

ProseDashes counts em dashes used as sentence breaks; ranges between numbers ("13—14 Nov") are not counted.

func Rules

func Rules() []finding.Rule

Rules describes every prose rule.

Types

type Earlier

type Earlier struct {
	File     string
	Markdown string
}

Earlier is a text already published, for the repetition check.

type TellHit

type TellHit struct {
	Segment int
	Phrase  string
	Count   int
	Repeat  bool // a construction that counts only from its second use
}

TellHit is one stock phrase or repeated construction found in a sequence of prose segments: the segment of its first match, that match and how often it occurred across all segments.

func FindTells

func FindTells(segments []string) []TellHit

FindTells applies the copy tells of copy.tells to plain prose segments, such as the paragraphs of a book chapter, with the same thresholds.

type Text

type Text struct {
	File     string // for findings
	Markdown string // without front matter
	Language string // BCP 47, e.g. en or de
	Earlier  []Earlier
}

Text is one piece of writing.

Jump to

Keyboard shortcuts

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