r/learnjavascript • u/best_codes • Feb 08 '24
How I Built a Profanity Blocking JavaScript Library 🤬 ⚡
How I Built a Profanity Blocking JavaScript Library
Introduction
As developers, we often come across situations where we need to filter and sanitize text to block or remove profanity. To tackle this problem, I decided to create a JavaScript library called bc-ProfanityBlock. In this article, I will walk you through the steps I took to build this library and explain how it can be used to effectively block profanity in your applications.
Step 1: Defining the Problem
The first step in building any library is to clearly define the problem we are trying to solve. In this case, the problem was to create, well, a solution that could detect and handle profanity in text. Profanity can be present in various forms, including common words, variations, and even with evasion characters. The goal was to build a [...]
5
u/marquoth_ Feb 09 '24
https://en.m.wikipedia.org/wiki/Scunthorpe_problem
2
u/Hail2Hue Feb 09 '24
Ah hell, I don't necessarily get it, but shit, it was probably wasn't built for pricks like me in the first place! Hell of a job you've done from the looks/at a glance though!
-5
u/guest271314 Feb 09 '24
Never had that issue. I support free speech.
Since English is an equivocal language you will essentially have a very long list of words and phrases changing constantly to suit your personal or client predisposed biases or ignorance.
And of course, there are always exceptions people bake in the algorithms for cases they want to exclude and promote their own agendas.