Shutup improvements (#9930)

* support pluralising es and de in shutup

* tweak dict and comments

*past tenses are redundant in en dict
*add comment and clarify which dictionaries are pluralized
pull/9933/head
Konstantinos07 2021-10-05 09:17:57 +03:00 committed by GitHub
parent 6c5d02f561
commit 5cb1cd5b0a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 7 deletions

View File

@ -31,10 +31,14 @@ object Analyser {
Dictionary.en.map { word =>
word + (if (word endsWith "e") "" else "e?+") + "[ds]?+"
} ++
Dictionary.es ++
Dictionary.es.map { word =>
word + (if (word endsWith "e") "" else "e?+") + "s?+"
} ++
Dictionary.hi ++
Dictionary.fr ++
Dictionary.de ++
Dictionary.de.map { word =>
word + (if (word endsWith "e") "" else "e?+") + "[nrs]?+"
} ++
Dictionary.tr ++
Dictionary.it ++
bannedYoutubeIds

View File

@ -1,13 +1,14 @@
package lila.shutup
/** - words are automatically pluralized. "tit" will also match "tits"
* - words are automatically leetified. "tit" will also match "t1t", "t-i-t", and more.
/** - words are automatically leetified. "tit" will also match "t1t", "t-i-t", and more.
* - words do not partial match. "anal" will NOT match "analysis".
* - en, es and de words are automatically pluralized. "tit" will also match "tits", "cabron" will also match "cabrones" etc.
* - For en only: Past tense of last word in a string matches: "cheat" will also match "cheated", "you suck" will also match "you sucked" but "kill you" will NOT match "killed you"
*/
private object Dictionary {
def en = dict("""
(f+|ph)(u{1,}|a{1,}|e{1,})c?k(er|r|u|k|ed|d|t|ing?|ign|en|tard?|face|off?|)
(f+|ph)(u{1,}|a{1,}|e{1,})c?k(er|r|u|k|t|ing?|ign|en|tard?|face|off?|)
(f|ph)agg?([oi]t|)
[ck]um(shot|)
[ck]unt(ing|)
@ -32,7 +33,7 @@ bugger
buk?kake
bull?shit
cancer
cheat(ing|ed|er|)
cheat(ing|er|)
chess(|-|_)bot(.?com)?
chicken
chink
@ -49,7 +50,7 @@ dogg?ystyle
douche(bag|)
dyke
engine
fck(er|r|u|k|ed|d|t|ing?|ign|tard?|face|off?|)
fck(er|r|u|k|t|ing?|ign|tard?|face|off?|)
foreskin
gangbang
gay