Ask coding questions

← Back to all posts
How To Detect Gibberish In Python?
joecooldoo

I have been getting a lot of spam in a python server I have containing bad words and gibberish. I've handled the bad word part, but can't find out how to do the gibberish part. Iv'e tried all sorts of methods. Someone please help?

Voters
joecooldoo
Comments
hotnewtop
ch1ck3n
joecooldoo

@ch1ck3n and how would I use this? Be more descriptive.

ch1ck3n

@joecooldoo why dont you try figuring it out by yourself

joecooldoo

@ch1ck3n Thats not very nice. Im fairly new to python.

ch1ck3n
joecooldoo

@ch1ck3n How would I give it training data

ch1ck3n

@joecooldoo its not machine learning

ch1ck3n
joecooldoo

@ch1ck3n How would I use that in a project?

ch1ck3n

@joecooldoo figure it out

joecooldoo

@ch1ck3n StOp SaYiNg ThAt

Coder100

you could try and compare it against a dictionary, and also try to see how many repeating characters there are next to each other (like string[0] == string[1] and string[1] == string[2] and string[3] == string[4])

or, you could just ban the spammers :)

joecooldoo

@Coder100 I tried that already, and I don't know how I would ban them. Could you help me with that? My repl is here: https://replit.com/@joecooldoo/Snap-Extensions

Coder100

@joecooldoo you could compare their username with a list of blacklisted names.