Documentation
¶
Overview ¶
Package stylestat 对已写正文做全书级风格统计,产出纯事实。
动机:弧内评审窗口(~10 章)对全书级模式固化天然失明——句式 tic 章均几十次、 章末形态同构、跨章复读,单章看每处都"正常",只有全书统计能暴露。统计归代码 (确定性、零幻觉),裁定归 LLM(editor 按数字判维度分,writer 据此自避免)。 Compute 供离线评测一次性全量计算;运行时使用 Tracker 按章节增量维护。
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 章末行形态分布。短结尾本身合法,全书同构才是问题。
type PatternStat ¶
type PatternStat struct {
Name string `json:"name"`
Total int `json:"total"`
PerChapter float64 `json:"per_chapter"`
}
PatternStat 固定句式模式类的全书计数(通用 AI 文风 tic)。
type PhraseStat ¶
PhraseStat 最近 phraseWindow 章内挖掘出的高频短语。
type SentenceStat ¶
type SentenceStat struct {
Text string `json:"text"`
Chapters int `json:"chapters"`
Count int `json:"count"`
}
SentenceStat 跨章逐字重复的长句(复读交代的直接证据)。
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 全书风格统计结果。所有字段都是事实计数,不含任何裁定或指令。
type TitleStat ¶
type TitleStat struct {
WithPrefix int `json:"with_prefix"`
WithoutPrefix int `json:"without_prefix"`
}
TitleStat 章节标题「第N章」前缀混用计数(混用=机制痕迹暴露在产物里)。
type Tracker ¶ added in v0.7.5
type Tracker struct {
// contains filtered or unexported fields
}
Tracker 按章节维护全书风格统计。首次载入每章一次;新增或重写时只分析变化章节。 Snapshot 会缓存派生结果,同一书状态下 Writer/Editor 的重复读取不再重算。
func NewTracker ¶ added in v0.7.5
func NewTracker() *Tracker
Click to show internal directories.
Click to hide internal directories.