pub struct LengthDistribution {
pub short: f32,
pub medium: f32,
pub long: f32,
pub short_max_words: u16,
pub medium_max_words: u16,
}Expand description
Sentence-length distribution target.
Used as a soft prior — the rhythm scorer treats the profile’s distribution as a nudge alongside its existing repetition + cadence terms; the Self-Refine retro-pass uses it as one signal among several rather than a hard constraint. Values are interpreted as proportions and need not sum to 1.0; the scorer normalizes internally. Boundary thresholds in words are configurable so a profile can declare what “short” means for its target voice.
Fields§
§short: f32Target proportion of sentences with word count <= short_max_words.
medium: f32Target proportion of sentences with word count <= medium_max_words
but > short_max_words.
long: f32Target proportion of sentences with word count > medium_max_words.
short_max_words: u16Inclusive upper bound, in words, that classifies a sentence as short.
medium_max_words: u16Inclusive upper bound, in words, that classifies a sentence as
medium. Must be >= short_max_words (validated at construction).
Implementations§
Source§impl LengthDistribution
impl LengthDistribution
Sourcepub fn neutral() -> Self
pub fn neutral() -> Self
Neutral distribution — uniform target with no shape preference.
Equivalent to “no profile target,” and what StyleProfile::neutral()
returns. Boundary defaults (short_max_words = 8,
medium_max_words = 18) match the rhythm scorer’s working ranges.
Sourcepub fn is_neutral(&self) -> bool
pub fn is_neutral(&self) -> bool
Returns true when this distribution is the neutral default —
the rhythm scorer’s profile-aware path short-circuits when it is,
preserving byte-for-byte equivalence with the no-profile path.
Trait Implementations§
Source§impl Clone for LengthDistribution
impl Clone for LengthDistribution
Source§fn clone(&self) -> LengthDistribution
fn clone(&self) -> LengthDistribution
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for LengthDistribution
impl Debug for LengthDistribution
Source§impl Default for LengthDistribution
impl Default for LengthDistribution
Source§impl PartialEq for LengthDistribution
impl PartialEq for LengthDistribution
Source§fn eq(&self, other: &LengthDistribution) -> bool
fn eq(&self, other: &LengthDistribution) -> bool
self and other values to be equal, and is used by ==.