ConsoleTVs / Profanity

PHP library to block bad words in a string
MIT License
98 stars 46 forks source link

New feature requested: matching not just a single word #4

Open hoanguel opened 6 years ago

hoanguel commented 6 years ago

Supposed we have a dictionary like this:

[ { "language": "en", "word": "wrapping men" }, { "language": "en", "word": "wrinkled starfish" }, ]

Can we have the badWords() to pick out only these whole strings. For example:

Sentence 1: a men is wrapping gift -> no problem Sentence 2: a gift is wrapping men -> bad words detected -> Result ["language" => "en", "word" =>"wrapping men"]

Thank you!