Skip to main content

inflect_reflexive

Function inflect_reflexive 

Source
pub fn inflect_reflexive(subject: &str, to_plural: bool, uc: bool) -> String
Expand description

Inflect reflexive pronoun (myself, yourself, himself, herself, itself, thyself, ourselves, yourselves, themselves) as to_plural indicates. The first character capitalized with uc set.

pluralize_pronoun leaves “you” as “you” regardless of number (English doesn’t distinguish singular/plural “you” in its subjective/objective/possessive forms), so unlike the other inflect_* functions here, reflexive “you” is special-cased on to_plural directly to choose between “yourself” and “yourselves”.

An unrecognized subject degrades to it’s forms rather than panicking — this is public API reachable with a caller-supplied string, not just already-validated Noun/Ranting data flowing through say!()’s own call sites.

§Examples

    let alex = Noun::new("Alex", "they");

assert_eq!(say!("{alex hurt} {%alex}."), "Alex hurt themselves.".to_string());