pub struct AssertionSentence {
pub subject: String,
pub verb: String,
pub object: String,
pub qualifiers: Vec<String>,
pub negated: bool,
}
Expand description
Represents a complete sentence structure for an assertion
Fields§
§subject: String
The subject of the assertion (usually the variable name)
verb: String
The verb of the assertion (e.g., “be”, “have”, “contain”)
object: String
The object of the assertion (e.g., “greater than 42”, “of length 5”, “‘test’”)
qualifiers: Vec<String>
Optional qualifiers for the assertion (e.g., “within tolerance”, “when rounded”)
negated: bool
Whether the assertion is negated (e.g., “not be”, “does not have”)
Implementations§
Source§impl AssertionSentence
impl AssertionSentence
Sourcepub fn new(verb: impl Into<String>, object: impl Into<String>) -> Self
pub fn new(verb: impl Into<String>, object: impl Into<String>) -> Self
Create a new assertion sentence
Sourcepub fn with_negation(self, negated: bool) -> Self
pub fn with_negation(self, negated: bool) -> Self
Set whether the assertion is negated
Sourcepub fn with_qualifier(self, qualifier: impl Into<String>) -> Self
pub fn with_qualifier(self, qualifier: impl Into<String>) -> Self
Add a qualifier to the assertion
Sourcepub fn format(&self) -> String
pub fn format(&self) -> String
Format the sentence into a readable string (raw format, without subject)
Sourcepub fn format_grammatical(&self) -> String
pub fn format_grammatical(&self) -> String
Format the sentence with grammatically correct ‘not’ placement (after the verb) This is used for display purposes where improved grammar is desired
Sourcepub fn format_with_conjugation(&self, subject: &str) -> String
pub fn format_with_conjugation(&self, subject: &str) -> String
Format the sentence with the correct verb conjugation based on the subject
Trait Implementations§
Source§impl Clone for AssertionSentence
impl Clone for AssertionSentence
Source§fn clone(&self) -> AssertionSentence
fn clone(&self) -> AssertionSentence
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more