|
|
| sus := "(?x)\b(?: | | sus := "(?x)\b(?: |
| fortnite | | fortnite |
| |ass+ | | |ass+ |
| |poo+ | | |poo+ |
| |fart(?:ed|ing|s)? | | |fart(?:ed|ing|s)? |
| |suck(?:ed|ing|s)? | | |suck(?:ed|ing|s)? |
| |cool | | |cool |
| |gay | | |gay |
| |fat | | |fat |
| |balls | | |balls |
| |daddy | | |daddy |
| |i[ ]like | | |i[ ]like |
| |sexy? | | |sexy? |
| |racist | | |racist |
| )\b"; | | )\b"; |
|
| |
|
| page_namespace == 0 & | | page_namespace == 0 & |
| !("confirmed" in user_groups) & | | !("confirmed" in user_groups) & |
| added_lines irlike sus & | | added_lines irlike sus & |
| !(removed_lines irlike sus) & | | !(removed_lines irlike sus) & |
| ( | | ( |
| /* Baseline AGF */ | | /* Baseline AGF */ |
| score := 1.0; | | score := 1.0; |
|
| |
|
| /* More AGF on "sweary" pages */ | | /* More AGF on "sweary" pages */ |
| score := score + 0.2 * rcount("(?i)" + sus, old_wikitext); | | score := score + 0.2 * rcount("(?i)" + sus, old_wikitext); |
|
| |
|
| /* Added references */ | | /* Added references */ |
| ref_score := (count("<ref", added_lines) - count("<ref", removed_lines)); | | ref_cnt := (count("<ref", added_lines) - count("<ref", removed_lines)); |
| score := score + 2.0 * ref_score; | | clamped_ref_cnt := ref_cnt < -1 ? -1 : ref_cnt; |
| | score := score + 2.0 * ref_cnt; |
|
| |
|
| /* Added markup */ | | /* Added markup */ |
| markup_score := (rcount("[[{|]", added_lines)) - (rcount("[[{|]", removed_lines)); | | markup_cnt := (rcount("[[\]{}|]", added_lines)) - (rcount("[[\]{}|]", removed_lines)); |
| score := score + 0.1 * markup_score; | | clamped_markup_cnt := markup_cnt < -10 ? -10 : markup_cnt; |
| | score := score + 0.1 * clamped_markup_cnt; |
|
| |
|
| /* Added quotes or italics */ | | /* Added quotes or italics */ |
| quote_score := (rcount("(?<!')''(?!')|\"", added_lines)) - rcount("(?<!')''(?!')|\"", removed_lines); | | quote_cnt := (rcount("(?<!')''(?!')|\"", added_lines)) - rcount("(?<!')''(?!')|\"", removed_lines); |
| score := score + 0.5 * quote_score; | | clamped_quote_cnt := quote_cnt < 0 ? 0 : quote_cnt; |
| | score := score + 0.5 * clamped_quote_cnt; |
|
| |
|
| /* No summary */ | | /* No summary */ |
| score := score - 0.5 * (summary irlike "^(?:/\*.*?\*/)?\s*$"); | | score := score - 0.5 * (summary irlike "^(?:/\*.*?\*/)?\s*$"); |
|
| |
|
| /* Did they add these words and do nothing else except adjust whitespace and punctuation? */ | | /* 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)); | | score := score - 2.0 * (norm(str_replace_regexp(added_lines, sus, "")) == norm(removed_lines)); |
|
| |
|
| /* Multiple bad words */ | | /* Multiple bad words */ |
| score := score - 0.5 * (rcount("(?i)" + sus, added_lines) - rcount("(?i)" + sus, removed_lines)); | | extra_cnt := rcount("(?i)" + sus, added_lines); |
| | | clamped_extra_cnt := extra_cnt > 10 ? 10 : extra_cnt; |
| /* Long runs */ | | score := score - 0.5 * clamped_extra_cnt; |
| two_sus := "(?i)(?:(?:" + sus + ")\W*){2}"; | | |
| score := score - 2.0 * (rcount(two_sus, added_lines) - rcount(two_sus, removed_lines)); | | /* 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; |
|
| |
|
| /* Large additions are probably more helpful */ | | /* Large additions are probably more helpful */ |
| pinned_edit_delta := edit_delta < -1000 ? -1000 : edit_delta > 1000 ? 1000 : edit_delta; | | clamped_edit_delta := edit_delta < -1000 ? -1000 : edit_delta > 1000 ? 1000 : edit_delta; |
| score := score + 0.001 * pinned_edit_delta; | | score := score + 0.001 * clamped_edit_delta; |
|
| |
|
| /* 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 */ | | /* 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)); | | score := score - 1.0 * (rcount("\w+", added_lines) == rcount("\w+", removed_lines)); |
|
| |
|
| /* Anying in all caps, not necessarily these words */ | | /* Anying in all caps, not necessarily these words */ |
| score := score - 1.0 * (rcount("[A-Z]{4,}", added_lines) > rcount("[A-Z]{4,}", removed_lines)); | | 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 */ | | /* Added plain text to the end of a single line */ |
| score := score - 1.0 * ( | | score := score - 1.0 * ( |
| strpos(norm(added_lines), norm(removed_lines)) == 0 & | | strpos(norm(added_lines), norm(removed_lines)) == 0 & |
| length(added_lines) == length(removed_lines) & | | length(added_lines) == length(removed_lines) & |
| quote_score + ref_score + markup_score == 0 | | quote_cnt + ref_cnt + markup_cnt == 0 |
| ); | | ); |
|
| |
|
| score < 0 | | score < 0 |
| ) | | ) |