Tired of offensive language in your app? 🚫 BadFilter.js to the rescue! We’ve crafted a supercharged, customizable solution that helps developers filter out inappropriate words like a pro. Let's make the internet a friendlier place one word at a time! 🌐💬
BadFilter.js offers two powerful components:
- FilterBadWord Class: The brains of the operation! This utility class is responsible for filtering unwanted words from your text.
- filters_badword Function: A lightweight wrapper around
FilterBadWord
for easier, more streamlined usage. Think of it as the "express mode" for your text-filtering needs!
With these components, you can easily cleanse your text, ensuring a respectful, safe online environment. 🚀✨
Both FilterBadWord and filters_badword combine Natural Language Processing (NLP) and Machine Learning (ML) for accurate and intelligent word filtering.
Here's the breakdown of the magic:
- Tokenization: Your text gets split into individual words (tokens) 🧩.
- NLP Analysis: The tokens are scanned using cutting-edge NLP algorithms to sniff out those pesky bad words 🕵️♂️.
- Machine Learning: Filtering gets smarter with each interaction, ensuring those inappropriate words vanish into thin air ✨.
- Customization: Want to fine-tune the filter to match your app's personality? You got it! Use the handy config method to tweak things to perfection 🎛️.
Want to use BadFilter.js in your web app? No problem! Here’s how:
<!-- Add badword.js into the HTML page -->
<script type="text/javascript" src="./badword.js"></script>
<!-- Or import directly if supporting ES Module -->
<script type="module" src="./badword.js">
</script>
<script>
const badfilter = new FilterBadWord("FUck master");
console.log(badfilter.clean(badfilter.position())); // Output: ***** master
</script>
Easy peasy, right? 🍋
If you’re working on a Node.js project, just use this:
const { FilterBadWord, filters_badword } = require('./badword.js');
// Express filtering using filters_badword
const badfilter = new FilterBadWord("FUck master");
console.log(badfilter.clean(badfilter.position())); // Output: ***** master
For full control over filtering, dive into the filters_badword class:
const badfilt = new filters_badword();
badfilt.config(true, false); // Custom filtering settings
badfilt.text_o("FUck master"); // Censored output: ***** master
console.log(badfilt.cleans);
console.log(badfilt.position()); // Shows position of the bad word
badfilt.text_o("motherfucker");
console.log(badfilt.cleans); // Output: *************
console.log(badfilt.position());
🔧 Config it your way! Customize how strict or lenient your filter should be using .config()
. Want more control? You got it!
Thanks to the NLP + ML combo, your filters get sharper over time, catching even the sneakier bad words. Say goodbye to offensive content! 🙅♂️🚫
Want to allow certain words or apply extra strict filtering? Adjust it with ease. You’re in the driver’s seat of how clean your app should be. Customize the experience and make it yours! 🛠️
We know speed matters! BadFilter.js is optimized to perform like a ninja—fast and precise. Your users won’t even notice the filtering happening in the background. 🌪️
- Accuracy: Spot-on detection of offensive words using cutting-edge algorithms 🎯.
- Customizable: Shape the filter to match your app’s personality 🎛️.
- Safe Spaces: Build a more positive, respectful community 🌸.
Whether you're building a chat app, a forum, or an online game, BadFilter.js will ensure everyone has a good time without the drama! 🎉
With BadFilter.js, you're one step closer to making the internet a more positive place. Say goodbye to offensive language and hello to a world of friendly interactions. Let's get filtering, and have some fun while we're at it! ✨
Go on, give it a spin and watch the magic unfold in your app! 🚀