Conditions:
(documentation) | sus := "(?x)\b(?:
#Common words
anal
|ass+
|balls
|booty
|bum
|butt
|caca
|cool(?:est)?
|cum
|daddy
|fart(?:ed|ing|s)?
|fat
|gay
|i[ ](?:like|hate)
|nonce
|poo+
|porno?
|racist
|sexy?
|smell[ys]
|stink[ys]
|suck(?:ed|ing|s)?
#Memes
|fortnite
|goat
|ronaldo
|sigma
)\b";
page_namespace == 0 &
!("confirmed" in user_groups) &
added_lines irlike sus &
!(removed_lines irlike sus) &
(
/* Baseline AGF */
score := 1.0;
/* More AGF on "sweary" pages */
score := score + 0.2 * rcount("(?i)" + sus, old_wikitext);
/* Added references */
ref_cnt := (count("<ref", added_lines) - count("<ref", removed_lines));
clamped_ref_cnt := ref_cnt < -1 ? -1 : ref_cnt;
score := score + 2.0 * ref_cnt;
/* Added markup */
markup_cnt := (rcount("[[\]{}|*#=]", added_lines)) - (rcount("[[\]{}|*#=]", removed_lines));
clamped_markup_cnt := markup_cnt < -10 ? -10 : markup_cnt;
score := score + 0.1 * clamped_markup_cnt;
/* Added quotes or italics */
quote_cnt := (rcount("(?<!')''(?!')|\"", added_lines)) - rcount("(?<!')''(?!')|\"", removed_lines);
clamped_quote_cnt := quote_cnt < 0 ? 0 : quote_cnt;
score := score + 0.5 * clamped_quote_cnt;
/* Unenclopedic language */
bonus_words := "\b(?:i|me|my|your?)\b";
score := score - 0.5 * (added_lines irlike bonus_words & !(removed_lines irlike bonus_words));
/* No summary */
score := score - 0.5 * (summary irlike "^(?:/\*.*?\*/)?\s*$");
/* Did they add these words and do nothing else except adjust whitespace and punctuation? */
score := score - 2.0 * (norm(str_replace_regexp(added_lines, sus, "")) == norm(removed_lines));
/* Multiple bad words */
extra_cnt := rcount("(?i)" + sus, added_lines) - 1;
clamped_extra_cnt := extra_cnt > 10 ? 10 : extra_cnt;
score := score - 0.5 * clamped_extra_cnt;
/* Back-to-back bad words */
tandem_cnt := rcount("(?i)(?:(?:" + sus + ")\W*){2}", added_lines);
clamped_tandem_cnt := tandem_cnt > 10 ? 10 : tandem_cnt;
score := score - 2.0 * tandem_cnt;
/* On the other hand, if the word count is exactly the same, that probably means they just swapped out one word, or did a search-and-replace */
score := score - 1.0 * (rcount("\w+", added_lines) == rcount("\w+", removed_lines));
/* Anying in all caps, not necessarily these words */
score := score - 1.0 * (rcount("[A-Z]{4,}", added_lines) > rcount("[A-Z]{4,}", removed_lines));
/* Added plain text to the end of a single line */
score := score - 1.0 * (
strpos(norm(added_lines), norm(removed_lines)) == 0 &
length(added_lines) == length(removed_lines) &
quote_cnt + ref_cnt + markup_cnt == 0
);
/* Added plain text to the start or end of the page */
score := score - 2.0 * (
strpos(norm(new_wikitext), norm(old_wikitext)) != -1 &
quote_cnt + ref_cnt + markup_cnt == 0
);
/* No changes at all to punctuation or markup */
score := score - 2.0 * (str_replace_regexp(added_lines, "[\w\s]", "") == str_replace_regexp(removed_lines, "[\w\s]", ""));
/* Not much use of the shift key */
score := score - 1.0 * (rcount('[A-Z]', added_lines) == rcount('[A-Z]', removed_lines));
score < 0
)
|
Tools: | Export this filter to another wiki
|