https://oceanplayground.social/@news_unlisted/109349123070354334
This post was given a content warning of "Death", which is configured this way:
[[content_warnings]]
label = "Death"
phrases = [
"murder", "killing", "death", "suicide", "die", "kill", "killed",
"fatal", "genocide", "shooting", "human remains", "homicide"
]
Titles and descriptions are searched using case-insenitive regex matching within word boundaries (\b). an s is optional for all words, it's a lazy way of matching plural forms. 1
|
let re = Regex::new(&format!(r"(?i)\b{}s?\b", phrase)).unwrap(); |
|
let phrase_found = re.is_match(title) || re.is_match(description); |
Here's the text of the description + title:
Source: CBC #news #novascotia
Under fire over claims of political interference, Lucki calls for new rules on #rcmp's relationship with Ottawa
#rcmp Commissioner Brenda Lucki says it's time to bring in better guardrails between the national police force and the federal government to avoid future allegations of political interference.
https://oceanplayground.social/@news_unlisted/109349123070354334
This post was given a content warning of "Death", which is configured this way:
Titles and descriptions are searched using case-insenitive regex matching within word boundaries (
\b). ansis optional for all words, it's a lazy way of matching plural forms. 1mastodon-rss/src/lib.rs
Lines 27 to 28 in 3232c9e
Here's the text of the description + title:
Footnotes
maybe that's what's doing it? thenope. ↩s?might match the whole word, so then we're just matching consequitive word boundaries.