https://github.com/dewanakl/aman
🤬 Filter kata kotor sederhana dengan regex. Cek, sensor, dan hapus kata kasar dengan pola karakter mirip.
https://github.com/dewanakl/aman
bad-words content-moderation filter input-sanitization kata-kotor moderation-tools php profanity profanity-filter regex regex-filters safe-text string-processing text-censorship text-cleaning text-filter text-processing text-sanitizer text-validation word-filter
Last synced: 3 months ago
JSON representation
🤬 Filter kata kotor sederhana dengan regex. Cek, sensor, dan hapus kata kasar dengan pola karakter mirip.
- Host: GitHub
- URL: https://github.com/dewanakl/aman
- Owner: dewanakl
- License: mit
- Created: 2023-12-26T15:57:31.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-06-25T01:51:19.000Z (9 months ago)
- Last Synced: 2025-09-06T04:54:11.292Z (7 months ago)
- Topics: bad-words, content-moderation, filter, input-sanitization, kata-kotor, moderation-tools, php, profanity, profanity-filter, regex, regex-filters, safe-text, string-processing, text-censorship, text-cleaning, text-filter, text-processing, text-sanitizer, text-validation, word-filter
- Language: PHP
- Homepage:
- Size: 85.9 KB
- Stars: 2
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
README

# 🤬 Simple Profanity Filter
This is a simple project that filters out profane words using regex in PHP. It provides functions to check, get, mask, and remove unwanted words from a text using regex patterns that account for similar characters.
## 📦 Installation
1. Run the following command in your project directory:
```bash
composer require kamu/aman
```
2. How to Add Blocklist or Allowlist Words
```php
// Add words to the blocklist
Aman::extend(['oke', 'safe']);
// Add words to the whitelist
Aman::allow(['oke', 'safe']);
```
## 🛠️ Usage
1. Check for Profane Words
```php
use Kamu\Aman;
$text = "This is an example with bad words.";
$filter = Aman::factory();
if ($filter->check($text)) {
echo "This text contains profanity.";
} else {
echo "This text is clean.";
}
```
2. Mask Profane Words
```php
$text = "This is an example with bad words.";
$maskedText = $filter->masking($text, '*');
echo $maskedText; // Output: "This is an example with *** ****."
```
3. Remove Profane Words
```php
$text = "This is an example with bad words.";
$cleanText = $filter->filter($text);
echo $cleanText; // Output: "This is an example with ."
```
4. Get Profane Words from Text
```php
$text = "This is an example with bad words.";
$badWords = $filter->words($text);
print_r($badWords); // Output: ['bad', 'words']
```
## 🤝 Contributing
I'm very open to those of you who want to contribute to the Aman!
## 🐞 Security Vulnerabilities
If you find any security vulnerabilities in this Aman, please email DKL via [dewanakretarta29@gmail.com](mailto:dewanakretarta29@gmail.com).
## 📜 License
Aman is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).