https://github.com/aashahin/profanity-i18n
A simple profanity filter for multiple languages with size 40kb.
https://github.com/aashahin/profanity-i18n
bad-word bad-words bad-words-censor bad-words-filter profanity profanity-filter
Last synced: 8 months ago
JSON representation
A simple profanity filter for multiple languages with size 40kb.
- Host: GitHub
- URL: https://github.com/aashahin/profanity-i18n
- Owner: aashahin
- License: mit
- Created: 2023-12-27T19:55:56.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-12-28T15:06:59.000Z (over 2 years ago)
- Last Synced: 2025-09-19T04:55:40.689Z (9 months ago)
- Topics: bad-word, bad-words, bad-words-censor, bad-words-filter, profanity, profanity-filter
- Language: JavaScript
- Homepage:
- Size: 27.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# profanity-i18n
A simple profanity filter for multiple languages

## Installation
Use the package manager [npm](https://www.npmjs.com/) to install the package.
```bash
npm install profanity-i18n
```
## Usage
```typescript
import profanity from 'profanity-i18n';
// Filter a string
profanity.filter('هذه جملة فيها كلمات سيئة'); // هذه جملة فيها كلمات ***
profanity,filter('This is a string with bad words'); // This is a string with *** words
// Check if contains profanity
profanity.contains('هذه', 'جملة', 'فيها', 'كلمات', 'سيئة'); // true
profanity.contains('This', 'is', 'a', 'string', 'with', 'bad', 'words'); // true
// Get a list of bad words
profanity.list(['هذه', 'جملة', 'فيها', 'كلمات', 'سيئة']); // ['هذه', 'جملة', 'فيها', 'كلمات', 'سيئة']
profanity.list(['This', 'is', 'a', 'string', 'with', 'bad', 'words']); // ['bad', 'words']
// Add a word to the list
profanity.add(['هذه', 'جملة', 'فيها', 'كلمات', 'سيئة']);
profanity.add(['This', 'is', 'a', 'string', 'with', 'bad', 'words']);
// Remove a word from the list
profanity.remove(['هذه', 'جملة', 'فيها', 'كلمات', 'سيئة']);
profanity.remove(['This', 'is', 'a', 'string', 'with', 'bad', 'words']);
```
## Supported Languages
- English
- Arabic
## Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
## License
[MIT](https://opensource.org/license/MIT)