Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: about 2 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 (about 1 year ago)
- Default Branch: master
- Last Pushed: 2023-12-28T15:06:59.000Z (about 1 year ago)
- Last Synced: 2024-11-08T17:04:38.802Z (about 2 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
Awesome Lists containing this project
README
# profanity-i18n
A simple profanity filter for multiple languages![npm](https://img.shields.io/npm/v/profanity-i18n?style=flat-square)
## 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)