ProfanityDetector icon indicating copy to clipboard operation
ProfanityDetector copied to clipboard

The reverse-Scunthorpe problem

Open aaron-bond opened this issue 6 years ago • 13 comments

Hi there,

Assuming I have a use-case where I want the profanity in Scunthorpe to be detected - is that something I can do here? I've had a look through the public methods and can't find anything appropriate. Any suggestions?

Thanks!

aaron-bond avatar Jul 06 '20 17:07 aaron-bond

Do you mean, if you had the sentence "I like in a town called Scunthorpe," that the profanity detector would flag 'Scunthorpe' because it contains the 'C' word?

stephenhaunts avatar Jul 06 '20 21:07 stephenhaunts

@stephenhaunts yep, exactly. Is that a thing?

aaron-bond avatar Jul 06 '20 21:07 aaron-bond

@stephenhaunts if it's not something the package already does, would you be open to a PR with a new public method specifically to find cases like Scunthorpe?

aaron-bond avatar Jul 07 '20 11:07 aaron-bond

Yeah, I would be up for that. What's the use-case for doing that case? Do you have a specific example?

The original intention was to solve the Scunthorpe problem as a lot of other profanity filters don't resolve it.

stephenhaunts avatar Jul 07 '20 14:07 stephenhaunts

In my case it's a tool that generates random Ids for users; I don't want to end up with ass123 accidentally so this tool can give me a retry case.

aaron-bond avatar Jul 07 '20 14:07 aaron-bond

ah, interesting, I hadn't considered that :-)

stephenhaunts avatar Jul 07 '20 16:07 stephenhaunts

Hi @stephenhaunts, thanks for this. We have exactly the same issue, slightly different use case: we don't want to allow users to create usernames containing profanities. Unless you or @aaron-bond are working on this already, I can submit a PR?

willemaster avatar Jul 09 '20 16:07 willemaster

My PR has been merged already; the method is ContainsProfanity. I think @stephenhaunts is planning to release the nuget package with the update.

aaron-bond avatar Jul 09 '20 17:07 aaron-bond

Hi, I will try and the NuGet packages updated and uploaded tonight (UK time). Things have been a little slow as still homeschooling 2 kids. Oh, the joy... :-)

stephenhaunts avatar Jul 09 '20 18:07 stephenhaunts

Hi, I have uploaded the latest nuget package, v0.1.6

Steve

stephenhaunts avatar Jul 09 '20 19:07 stephenhaunts

Merged pull request with request feature and re-released nuget package with latest feature.

stephenhaunts avatar Jul 09 '20 19:07 stephenhaunts

Amazing, thanks both and good luck with the homeschooling :)

willemaster avatar Jul 09 '20 19:07 willemaster

Thank you kindly @stephenhaunts

aaron-bond avatar Jul 09 '20 20:07 aaron-bond