Documentation
¶
Overview ¶
Package textprose cuts what an assistant wrote into the part it SAYS and the sentences of that part. It started as a copy of statecheck's own pair of functions; statecheck still keeps its own copy (cmd/statecheck/main.go), and only quotaclaim (through internal/quotapat) uses this one.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Prose ¶
Prose strips what is not the assistant speaking for itself: fenced and inline code, block quotes, quotations.
func Sentences ¶
Sentences splits on . ! ? ; followed by space, and on newlines, keeping the terminator so a question can be told from an assertion.
func SentencesLines ¶ added in v0.205.0
SentencesLines is SentencesStrict without the soft-wrap join: every newline ends a sentence. A gate that joins wrapped lines also reads these, because a join can hand a claim a subject that exempts it ("…the usage limit" + "while the GitHub sweep ran").
func SentencesStrict ¶
SentencesStrict is the splitter of the claim gates (quotaclaim): sentences end at ! ? newline and at a dot, never at ;. A dot ends a sentence only at the end of the text, before a newline, or before whitespace followed by an uppercase letter, a digit, or a lowercase word that is not the continuation of an abbreviation ("e.g. the", "the U.S. is", "etc. and" do not split, and a dot between digits never does). Closing and opening markup (** _ " ) around the dot and the next word is looked through. A newline ends a sentence, except a soft wrap: a line that stops short of a terminator, is not a heading and is followed by a line that starts in lowercase continues.
Types ¶
This section is empty.