Documentation
¶
Overview ¶
Package stylestat computes book-wide style statistics over already-written prose and produces pure facts.
Motivation: an in-arc review window (~10 chapters) is blind by construction to book-wide pattern hardening -- a tic seen dozens of times per chapter, isomorphic chapter endings and cross-chapter repetition all look "normal" chapter by chapter, and only book-wide statistics expose them. Counting belongs to the code (deterministic, zero hallucination), judgement to the LLM (editor scores dimensions from the numbers, writer avoids them). Compute is the offline one-shot path, Tracker the runtime one.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EndingStat ¶
type EndingStat struct {
ShortRatio float64 `json:"short_ratio"`
MedianRunes int `json:"median_runes"`
}
EndingStat is the distribution of chapter-final line shapes. A short ending is legitimate on its own; book-wide isomorphism is the problem.
type Input ¶
Input is the statistics input. Chapters is ordered by ascending chapter number; Stopwords holds proper nouns such as character names, which are skipped during dynamic phrase mining (a recurring character name is naturally frequent, not a style problem).
type PatternStat ¶
type PatternStat struct {
Name string `json:"name"`
Total int `json:"total"`
PerChapter float64 `json:"per_chapter"`
}
PatternStat is the book-wide count of fixed sentence-pattern classes (generic AI prose tics).
type PhraseStat ¶
PhraseStat holds the frequent phrases mined from the last phraseWindow chapters.
type SentenceStat ¶
type SentenceStat struct {
Text string `json:"text"`
Chapters int `json:"chapters"`
Count int `json:"count"`
}
SentenceStat holds long sentences repeated verbatim across chapters (direct evidence of padding recaps).
type Stats ¶
type Stats struct {
Chapters int `json:"chapters"`
Patterns []PatternStat `json:"patterns,omitempty"`
TopPhrases []PhraseStat `json:"top_phrases,omitempty"`
RepeatedSentences []SentenceStat `json:"repeated_sentences,omitempty"`
Ending EndingStat `json:"ending"`
OpeningTimeRate float64 `json:"opening_time_rate"`
TitleFormats *TitleStat `json:"title_formats,omitempty"`
}
Stats is the book-wide style statistics result. Every field is a factual count, with no verdict and no instruction.
type TitleStat ¶
type TitleStat struct {
WithPrefix int `json:"with_prefix"`
WithoutPrefix int `json:"without_prefix"`
}
TitleStat counts mixed use of the "Chapter N" title prefix (mixing = the machinery showing through in the artifact).
type Tracker ¶
type Tracker struct {
// contains filtered or unexported fields
}
Tracker maintains the book-wide style statistics per chapter. On first load every chapter is analysed once; on append or rewrite only the changed chapters are. Snapshot caches the derived results, so repeated Writer/Editor reads in the same book state are not recomputed.
func NewTracker ¶
func NewTracker() *Tracker