Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
/BadFilter.jsPublic template

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!

NotificationsYou must be signed in to change notification settings

LcfherShell/BadFilter.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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! 🌐💬


🛠️Overview

BadFilter.js offers two powerful components:

  • FilterBadWord Class: The core engine of the library, responsible for detecting and filtering unwanted words from text.
  • filters_badword Function: A simplified, express-mode interface that wraps aroundFilterBadWord for quick and easy usage.

These tools let you build respectful, safe online environments with minimal effort. 🚀✨


🔧How It Works

BothFilterBadWord andfilters_badword leverage Natural Language Processing (NLP) and Machine Learning (ML) to perform accurate and intelligent filtering.

Here's how the magic happens:

  1. Tokenization: Text is broken down into words (tokens) 🧩.
  2. NLP Analysis: Tokens are scanned for potential offensive content using NLP techniques 🕵️‍♂️.
  3. Machine Learning: Each interaction makes the filter smarter at catching new or obfuscated terms ✨.
  4. Customization: You can configure how strict or lenient the filter should be with advanced options 🎛️.

🚀Getting Started

1️⃣HTML Setup

Include it in your browser-based projects:

<!-- Add BadFilter.js via CDN --><scripttype="text/javascript"src="https://cdn.jsdelivr.net/npm/badfilter-js@2.0.13/dist/badword.min.js"></script><!-- or --><scripttype="text/javascript"src="https://cdn.jsdelivr.net/npm/badfilter-js@2.0.13/js/badword.min.js"></script><!-- Or use ES Module --><scripttype="module"src="https://cdn.jsdelivr.net/npm/badfilter-js@2.0.13/dist/badword.min.js"></script><!-- or --><scripttype="module"src="https://cdn.jsdelivr.net/npm/badfilter-js@2.0.13/js/badword.min.js"></script><script>constbadfilter=newFilterBadWord("FUck master");console.log(badfilter.clean(badfilter.position()));// Output: ***** master</script>

2️⃣Node.js Setup

For backend or CLI usage:

const{ FilterBadWord, filters_badword}=require('badfilter-js');// Basic usageconstbadfilter=newFilterBadWord("FUck master");console.log(badfilter.clean(badfilter.position()));// Output: ***** master

🎯Express Mode:filters_badword

A more concise class for common use cases:

constbadfilt=newfilters_badword();// Customize filter rulesbadfilt.config(true,true,"dict|kick|chicky hu","stupid|badly");// Set input textbadfilt.text_o("kick master fck");console.log(badfilt.cleans);// Output: **** master ***console.log(badfilt.position());// Get positions of filtered words

🌟Latest Updates

We're constantly improving BadFilter.js! Here’s what’s new in the latest version:

✨ 1. Cleaned & Smartertext Method

Thetext_o() and related text processing methods have been refactored for better clarity, performance, and consistency—especially with large and multilingual text. Expect more stable and readable results.

🔎 2. Fuzzy Text Matching

We’ve introduced intelligent fuzzy matching to catch disguised or creatively-written offensive words such as:

  • “f@ck”, “f*ck”, “phuck”, “fucc”, etc.

This makes BadFilter.js far more effective in real-world, unstructured user input.

⚙️ 3. Advanced Configuration via Class Options

TheFilterBadWord class now comes with a flexibleoptions configuration, letting you control how the filter behaves:

options={filterUrls:false,// Whether to filter offensive words inside URLsfilterEmails:false,// Whether to filter inside email addressescontextSensitivity:2,// Number of surrounding words checked (range: 0–5)filterSeverity:2,// Level of strictness: 1 = light, 2 = medium, 3 = strictreplaceChar:'*',// Character used to replace offensive termspreserveFirstLast:false,// Whether to preserve first/last letters of censored wordspreserveLength:true,// Keep word length after filteringdetectMissingChars:true,// Enable detection of disguised/missing charactersignoreLastDigits:0// Ignore trailing numbers in a word (useful for usernames/IDs)};

This update enables nuanced handling of sensitive content, ensuring flexibility across different platforms, audiences, and use cases.


💡Features You'll Love

🧠AI-Powered Smart Filtering

Combining NLP and ML ensures the filter becomes smarter with each use—adapting to new slangs and obscure terms. Stop even the sneakiest of offenders!

🎨Fully Customizable

Tailor the filter to fit your app’s tone and community standards. Whether you want lenient or strict filtering, it's just a config away.

Blazing Fast

Performance matters. BadFilter.js is designed to be lightning fast, even under large text loads, keeping your app running smoothly.


🤔Why Choose BadFilter.js?

  • Accuracy: Industry-grade detection using fuzzy logic and contextual awareness.
  • 🔧Configurability: Powerful tuning options for filtering behavior.
  • 💬Safety First: Build inclusive communities free from toxicity and hate speech.

Perfect for chats, forums, social apps, education platforms, or any user-generated content.


🎬Wrap-Up

WithBadFilter.js, you're equipped to fight toxicity with precision and speed. Say goodbye to offensive language and hello to a clean, inclusive experience for everyone. 🧼✨

Start filtering today and join the movement toward a better, more respectful web. 🌐🚀

About

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!

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp