ProfanityDetector icon indicating copy to clipboard operation
ProfanityDetector copied to clipboard

Adding 'scunthorpe' to allow list does not prevent it being considered a profanity

Open willemaster opened this issue 6 years ago • 2 comments

It looks like the ContainsProfanity() method will consider 'scunthorpe' a profanity even if 'scunthorpe' is on the allow list, because it contains a profanity within itself.

The behaviour we require is to allow such words to be exempted, if they are on the allow list, even if a substring of the word being checked is a profanity.

I can submit a PR for this?

willemaster avatar Jul 13 '20 12:07 willemaster

Hi, use IsProfanity instead to get the desired behaviour. IsProfanity will specifically solve the Scunthorpe problem.

ContainsProfanity was added last week as a PR for a specific use-case or another company.

stephenhaunts avatar Jul 13 '20 13:07 stephenhaunts

From the documentation:

var filter = new ProfanityFilter(); Assert.IsTrue(filter.IsProfanity("@rsehole"));

stephenhaunts avatar Jul 13 '20 13:07 stephenhaunts