Socket
Socket
Sign inDemoInstall

profanity-hindi

Package Overview
Dependencies
1
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    profanity-hindi

Small Utility for checking profanity (hindi and English).It supports functionality like detecting bad words and cleaning them.


Version published
Maintainers
1
Install size
1.37 MB
Created

Readme

Source

profanity-hindi

Author : Suraj Kumar Jha

This is a small nodejs module for dealing with profanity in english and hindi. This Module has functionalities for detecting bad words and cleaning them. Technologies used : Nodejs

Installation

just run - npm install profanity-hindi

Requirements

It internally uses lodash , will be automatically installed

Code Example

function maskBadWords()
var profanity = require("profanity-hindi");
var message = "hi asshole you are a bitch chutiya";
var cleaned = profanity.maskBadWords(message);
console.log(cleaned); // hi ******* you are a ***** *******
function isMessageDirty()
var profanity = require("profanity-hindi");
var message = "hi asshole you are a bitch chutiya";
var isDirty = profanity.isMessageDirty(message);
console.log(isDirty);
// prints true

var message = "hi there. How are you";
var isDirty = profanity.isMessageDirty(message);
console.log(isDirty);
// prints false
function addWords()
var profanity = require("profanity-hindi");
 var newWords = ["this", "dumbness"];
 profanity.addWords(newWords); // this will add the new words 
 to the dictionary of bad words. This function optionally
 returns the entire dictionary of bad words.
function removeWords()
var profanity = require("profanity-hindi");
 var newWords = ["this", "dumbness"];
 profanity.removeWords(newWords); // this will remove the new words 
 from the dictionary of bad words. This function optionally
 returns the entire dictionary of bad words.

Unit Tests

Run command : npm test

Contributors

Suraj Kumar Jha

License

MIT License

Keywords

FAQs

Last updated on 24 Dec 2016

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc