mrmaxguns / wonderwordsmodule

Generate random words and sentences with ease in Python. Be on the lookout for bugfixes and speed improvements in 2.3
https://wonderwords.readthedocs.io
MIT License
53 stars 11 forks source link

Cursewords flag #8

Closed kiraacorsac closed 3 years ago

kiraacorsac commented 3 years ago

I'm generating adjective-noun pairs as job names for my projects.

Is your feature request related to a problem? Please describe. I would like not to serve my users random words like 'ugly fuck' or 'nasty shit'.

Describe the solution you'd like I would like to pass a flag to the generator, specifying whether I want curse words sprinkled into my random words. This flag would default to False (no curse words).

Describe alternatives you've considered I considered just leaving it as-is and laughing when somebody complains about their random words being something like 'massive cock'.

mrmaxguns commented 3 years ago

I didn't notice the curse word. Thanks for opening an issue. There would be three possible ways that I though of to implement this.

  1. Don't include curse words at all
  2. Add a separate list for curse words that will be loaded unless disabled
  3. Generate words, and then check if they are curse words from a list of curse words, then filter if required.

I'll probably implement one of these solutions by the next release. If you think of a solution, or want to implement it, let me know.

kiraacorsac commented 3 years ago

I think removing them completely is a good solution unless somebody comes up with a good argument against removing them. There might be some use case, however, so if you decide to go for options 2. or 3., they should default to SFW wordlist only - I think most customer-facing projects using this library would appreciate that.

mrmaxguns commented 3 years ago

I believe that choosing a SFW wordlist would be the best solution. In the next release I'll add the ability to create custom word categories, so that those who'll want to add custom word categories can do so.

mrmaxguns commented 3 years ago

Curse words have been removed and added to profanitylist.txt. Custom categories have also been implemented. :+1:

kiraacorsac commented 3 years ago

Great, thanks! Just so you know, profanitylist.txt is empty in the current version. Not an issue for me, but I don't think that's intentional.

mrmaxguns commented 3 years ago

Yes, I am aware. That was an accident. Fixed!