1.0.22 • Published 4 months ago
profanity-i18n v1.0.22
profanity-i18n
A simple profanity filter for multiple languages
Installation
Use the package manager npm to install the package.
npm install profanity-i18n
Usage
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
1.0.22
4 months ago
1.0.20
4 months ago
1.0.19
5 months ago
1.0.18
5 months ago
1.0.17
5 months ago
1.0.16
5 months ago
1.0.15
5 months ago
1.0.14
5 months ago
1.0.13
5 months ago
1.0.12
5 months ago
1.0.11
5 months ago
1.0.10
5 months ago
1.0.9
5 months ago
1.0.8
5 months ago
1.0.7
5 months ago
1.0.6
5 months ago
1.0.5
5 months ago
1.0.4
5 months ago
1.0.3
5 months ago
1.0.2
5 months ago
1.0.1
5 months ago
1.0.0
5 months ago