coffee-and-fun / google-profanity-words

Full list of bad words and top swear words banned by Google.
606 stars 250 forks source link

Feature Request : Search the whole sentence or paragraph #17

Closed nla-asia closed 1 year ago

nla-asia commented 1 year ago

I am not sure how is the .search function intended to be used. Currently, it cannot be used to check a sentence whether it contains cursed words or not. Searching only one word does not help much. I think I can loop through each word and call the .search function on each one but it should be already in the package.

RobertJGabriel commented 1 year ago

Hey @nla-asia,

Will get this added this week :)

Will post here when its updated.

Thank you for reporting.

RobertJGabriel commented 1 year ago

Hey @nla-asia

This function is now released. Just make sure you update to the latest version.


const sentence = 'Do not use bad words like mierda or idiota.';
const hasCurseWords = profanity.hasCurseWords(sentence);
// Returns true if the sentence contains profanity words, otherwise false.
nla-asia commented 1 year ago

awesome!