ConsoleTVs / Profanity

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

Incorrect word detection #22

Closed andrey-helldar closed 5 months ago

andrey-helldar commented 2 years ago
Package Version
consoletvs/profanity 3.1.0

I write:

who i am here

I get:

who i ** here

image

sebastianheise commented 2 years ago

The word am (unfortunately) is in the dictionary for language tr. By not being able to select a specific language when checking, it would mark any string containing a I am as profane, which makes it pretty much unusable for the English language :( I would propose to remove this word - or add an option to specify the language you want to filter. I have solved this by making my own copy of the dictionary and removing it.

jadeops commented 1 year ago

+1

I think we need 2 helper methods to extend the dictionary during runtime while keeping the default dictionary similar to https://www.npmjs.com/package/bad-words

->removeWords(['am']);
->addWords(['fucker']);