profanity-i18n

1.0.22 • Public • Published

profanity-i18n

A simple profanity filter for multiple languages

npm

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

MIT

Dependencies (0)

    Dev Dependencies (1)

    Package Sidebar

    Install

    npm i profanity-i18n

    Weekly Downloads

    5

    Version

    1.0.22

    License

    MIT

    Unpacked Size

    39.7 kB

    Total Files

    9

    Last publish

    Collaborators

    • abshahin