Skip to content

Added blacklist to stop offensive words#1

Open
AndrewScibek wants to merge 2 commits intomasterfrom
blacklist
Open

Added blacklist to stop offensive words#1
AndrewScibek wants to merge 2 commits intomasterfrom
blacklist

Conversation

@AndrewScibek
Copy link
Collaborator

What changes does this PR introduce?

Added a blacklist for words being created.

Where should the reviewer start?

By closing their eyes until after the blacklists/en file

Has this been manually tested? How?

136843250 words without a bad word found or a crash. I dont have until the heat death of the universe to find a bad word

What GIF best describes this PR or how it makes you feel?

login

next_letter = random.choices(
list(self.corpus.occurences[last_bigram]),
weights=self.corpus.occurences[last_bigram].values())[0]
try:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's possible to test this by using a corpus with one bad word and one good word in it. run it a couple of dozen times and verify that it only ever generates the good word.

@stephenprater
Copy link
Collaborator

There's a bunch of random crap you have to do if you want to make a release - but we can do that at a different time.

Forgot a word
@@ -0,0 +1,47 @@
anal
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dunno how I feel about having this list committed to github. 😬

word += next_letter

if word in self.blacklist:
word = random.choices(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feels like we could just put this in a loop with a retry rather than repeating the call?

@corbinlc
Copy link
Member

corbinlc commented Nov 4, 2019

@stephenprater and @AndrewScibek is this still a valid PR? I thought the blacklist was already in place, but not 100%

@AndrewScibek
Copy link
Collaborator Author

@corbinlc kinda but there are a lot of issues with it as pointed out by prater

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants