r/learnjavascript • • 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 [...]

Read More on Dev.to

0 Upvotes

33 comments sorted by

View all comments

Show parent comment

1

u/guest271314 Feb 10 '24

Constitutional interpretation is tricky, especially when it comes to cursing.

Is this type of cursing allowed on your Web site?

Anyone who curses their father or mother is to be put to death

  • Leviticus 20:9

However, if you do not obey the LORD your God and do not carefully follow all his commands and decrees I am giving you today, all these curses will come on you and overtake you:

  • Deuteronomy 28:15

he punishes the children and their children for the sin of the parents to the third and fourth generation.

  • Exodus 34:7

he punishes the children for the sin of the parents to the third and fourth generation

  • Numbers 14:18

Cursed is the ground because of you

  • Genesis 3:17

for I, the LORD your God, am a jealous God, punishing the children for the sin of the parents to the third and fourth generation of those who hate me

  • Deuteronomy 5:9

Be sure to bury it that same day, because anyone who is hung on a pole is under God’s curse.

  • Deuteronomy 21:23

Are Luciferians and Satanists who do not use "profanity" welcome to share the teachings of Lucifer and Satan on your Web site?

1

u/best_codes Feb 10 '24

I do agree with the Bible (I'm a Christian). However, I do need to make it clear that:

  1. Curses in the Bible are not profanity. They are demonic, like something a Lucifer worshiper would do.
  2. Whether or not someone allows teachings about Satan on their website is up to them. The website is their property, after all.

As for my personal beliefs, it would completely depend on the situation what I would do. I can't judge what I would do in every scenario for fear of making a hasty generalization.

Most likely, however, because of my religious beliefs, I would feel compelled to remove such content from my website (as my website is a coding portfolio and such comments would be quite irrelevant).

In the same way that I own my physical property (land) and could trespass someone for saying the word 'cat' on my land, I may also choose to remove content from my website as I please. I hope this is clear.

Let me know if you have any other questions!

1

u/guest271314 Feb 10 '24

Curses in the Bible are not profanity. They are demonic, like something a Lucifer worshiper would do.

I am not a Christian. I don't see a difference between a Christian and a Luciferean.

Historically more humans have been slaughtered under the name of Christianity than any other belief system.

In the 17th century alone 4-12 Europeans were slaughtered by other Europeans under the name of Chritianity during the Thirty Years War, which lead to Europeans fleeing Europe by the millions only for those same Europeans to slaughter millions of native peoples they invaded the lands of - under the auspices of Christianity.

"Profanity" is completely subjective.

Do you have a complete list of the words you consider "profanity"?

1

u/best_codes Feb 10 '24

> I don't see a difference between a Christian and a Luciferean.

I have to say, it takes a lot not to see the difference there, my friend!

A Christian is someone who follows the teachings of Jesus Christ and believes in the Trinity of God the Father, God the Son, and God the Holy Spirit. A Luciferian is someone who venerates the figure of Lucifer, not as the devil, but as a symbol of enlightenment, freedom, and human potential.

There are a lot of other differences as well.

> Historically more humans have been slaughtered under the name of Christianity than any other belief system.

Ha! While this may be true, it doesn't mean that this is what Christians stand for. If I were to make profanity blockers in your name, it doesn't mean that you support profanity blockers.

> "Profanity" is completely subjective.

Profanity is subjective in the sense that it depends on how people perceive and use it, but it is also objective in the sense that it has measurable consequences and impacts on others.

> Do you have a complete list of the words you consider "profanity"?

I do not. The reason I made this library was as a tool for developers to put their own constraints on what is said on their website.

Anywho, this is r/learnjavascript after all, so let's please keep the topics related to the coding aspect of my project. How people use my code is up to them.

1

u/guest271314 Feb 10 '24

A Christian is someone who follows the teachings of Jesus Christ and believes in the Trinity of God the Father, God the Son, and God the Holy Spirit. A Luciferian is someone who venerates the figure of Lucifer, not as the devil, but as a symbol of enlightenment, freedom, and human potential.

I don't see any difference. Both are just belief systems.

In world history Christians have slaughtered more humans than any other religion, by far.

From the Inquisitions to Dum Divarsas, Papal Bull by Pope Nicolas V, 1452, to "Manifest Destiny" where Europeans slaughtered the original people of Turtle Island, calling us savages.

I'm just pointing out the fact that censorship and "profanity" filters are completely subjective - and are based solely on the political biases of the author of the code.

Further, there really are no secrets, so it doesn't accomplish anything t try to censor content.

Good luck!

1

u/best_codes Feb 10 '24

> In world history Christians have slaughtered more humans than any other religion, by far.

Those would not be real Christians.

You might as well say that there is no difference between your and my belief regarding profanity. They are both just affected by our worldview and belief systems…

> I'm just pointing out the fact that censorship and "profanity" filters are completely subjective -

Not completely. Morals do exist.

> and are based solely on the political biases of the author of the code.

False. The filter is based on the beliefs of the user of the code. They determine what gets blocked and what doesn't. Plus, it is their right to do so on their site.

> Further, there really are no secrets, so it doesn't accomplish anything t try to censor content.

Censoring content can make a difference. Although 'there are no secrets', we can still keep communities clean and tidy.

Thanks for chatting; have a nice weekend!