#[non_exhaustive]pub struct StyleProfile {
pub name: String,
pub verbosity: Verbosity,
pub sentence_length: LengthDistribution,
pub connectives: ConnectivePreferences,
pub list_style_bias: ListStyleBias,
pub pronoun_density: PronounDensity,
pub hedging: HedgingCalibration,
pub salience: SalienceBias,
}Expand description
A declarative voice configuration for the engine.
Profiles are immutable per engine. Build one through
StyleProfile::builder, a serde-deserialized prosaic.toml
[style_profile] section, or one of the catalog presets. Apply via
Engine::style_profile.
StyleProfile::neutral() is the byte-for-byte-equivalent baseline:
constructing an engine with .style_profile(StyleProfile::neutral())
produces output identical to constructing it with no profile at all.
This invariant is the backwards-compatibility gate for the entire
design and is asserted by the round-trip tests at the workspace level.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.name: String§verbosity: Verbosity§sentence_length: LengthDistribution§connectives: ConnectivePreferences§list_style_bias: ListStyleBias§pronoun_density: PronounDensity§hedging: HedgingCalibration§salience: SalienceBiasImplementations§
Source§impl StyleProfile
impl StyleProfile
Sourcepub fn neutral() -> Self
pub fn neutral() -> Self
The byte-for-byte-equivalent baseline. Every dial in its neutral position; constructing an engine with this profile produces the same output as constructing it with no profile at all.
Sourcepub fn builder(name: impl Into<String>) -> StyleProfileBuilder
pub fn builder(name: impl Into<String>) -> StyleProfileBuilder
Start a builder rooted at neutral() with the given name.
Sourcepub fn is_neutral(&self) -> bool
pub fn is_neutral(&self) -> bool
true when this profile is byte-for-byte equivalent to the neutral
baseline — i.e., when every decision site can short-circuit its
profile-aware path. The name field is ignored: a custom name
applied to neutral dials is still an effective no-op.
Sourcepub fn validate(&self) -> Result<(), StyleProfileError>
pub fn validate(&self) -> Result<(), StyleProfileError>
Validate the profile against the documented invariants. Called by
the builder’s build() and at the engine boundary; consumers
passing a deserialized profile should call this before applying
it to an engine.
Trait Implementations§
Source§impl Clone for StyleProfile
impl Clone for StyleProfile
Source§fn clone(&self) -> StyleProfile
fn clone(&self) -> StyleProfile
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 StyleProfile
impl Debug for StyleProfile
Source§impl Default for StyleProfile
impl Default for StyleProfile
Source§impl PartialEq for StyleProfile
impl PartialEq for StyleProfile
Source§fn eq(&self, other: &StyleProfile) -> bool
fn eq(&self, other: &StyleProfile) -> bool
self and other values to be equal, and is used by ==.