Skip to main content

insert_not

Function insert_not 

Source
pub fn insert_not(phrase: &str) -> String
Expand description

Fallback negation: split the phrase after its first auxiliary and insert “not”. If the first word isn’t a recognizable aux, prepend “not “ — ungrammatical on its own but better than silently losing the negation (callers should register an antonym for this case).

Examples:

  • "was modified""was not modified"
  • "has been renamed""has not been renamed"
  • "will break""will not break"
  • "broke""not broke"