Remove sexually explicit typos rule and add migration for masked call participants
This commit is contained in:
@@ -559,43 +559,6 @@ impl Rule for ExplicitSexualLanguageRule {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
struct ExplicitSexualLanguageTypoRule {
|
||||
pattern: Regex,
|
||||
exceptions: Vec<String>,
|
||||
}
|
||||
|
||||
impl ExplicitSexualLanguageTypoRule {
|
||||
fn new() -> Self {
|
||||
let (phrases, exceptions) =
|
||||
parse_phrases_file(include_str!("lists/explicit-sexual-language-typos.txt"));
|
||||
|
||||
let regex = regex_from_phrases_list(&phrases);
|
||||
|
||||
Self {
|
||||
pattern: regex,
|
||||
exceptions,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Rule for ExplicitSexualLanguageTypoRule {
|
||||
fn action(&self) -> &'static Action {
|
||||
&Action::SoftCensorAndWarn
|
||||
}
|
||||
|
||||
fn name(&self) -> &'static str {
|
||||
"Explicit Sexual Language Typo"
|
||||
}
|
||||
|
||||
fn detect(&self, _original: &str, normalized: &str) -> (Vec<String>, Vec<String>) {
|
||||
(
|
||||
vec![],
|
||||
find_with_exceptions(normalized, &self.pattern, &self.exceptions),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
struct SuggestiveLanguageRule {
|
||||
pattern: Regex,
|
||||
@@ -805,7 +768,6 @@ pub static RULES: Lazy<Vec<Arc<dyn Rule>>> = Lazy::new(|| {
|
||||
Arc::new(HateSpeechAndSlursRule::new()),
|
||||
Arc::new(ThreatsAndSelfHarmRule::new()),
|
||||
Arc::new(ExplicitSexualLanguageRule::new()),
|
||||
Arc::new(ExplicitSexualLanguageTypoRule::new()),
|
||||
Arc::new(SuggestiveLanguageRule::new()),
|
||||
Arc::new(AdvertisingRule),
|
||||
Arc::new(SensitiveTopicsAndTriggeringContentRule::new()),
|
||||
|
||||
Reference in New Issue
Block a user