Giter Site home page Giter Site logo

osmancandulger / badword-filter Goto Github PK

View Code? Open in Web Editor NEW
4.0 1.0 2.0 351 KB

Bad word filter for English & Turkish words.

Home Page: https://www.npmjs.com/package/badword-filter

TypeScript 84.74% JavaScript 15.26%
badword-filter word-filter filter

badword-filter's Introduction

Bad Word Filter for EN && TR lang words

Coverage Badge

You may filter quickly your strings in a couple steps. You can check is provided string is valid ? or you can simply replace bad word with given character.(You can use swear words list only for English language for now.)

Related Functions

You can import related functions as follows;

import { checkIsValid, replaceWordWith } from 'badword-filter';

checkIsValid

This function takes two args and returns boolean as validation result.
You can use swear words list only for English language for now.

const ValidationOptions: object = {
  swear: boolean,
  negative: boolean,
  political: boolean,
  religions: boolean,
};

checkIsValid('word', ValidationOptions);
Parameter Type Description
data string Required. Your string to validate.
ValidationOptions object Required. Your wished badword list types.

replaceWordWith

This function takes three args and returns masked string with given pattern as validation result.
You can use swear words list only for English language for now.

const ValidationOptions: object = {
  swear: boolean,
  negative: boolean,
  political: boolean,
  religions: boolean,
};
replaceWordWith('word', '*', ValidationOptions);
Parameter Type Description
data string Required. Your string to validate.
replacementCharacter string Required. Your special character using as replacer.
ValidationOptions object Required. Your wished badword list types.

Demo

Authors

LICENCE

MIT License

badword-filter's People

Contributors

osmancandulger avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

badword-filter's Issues

The package is empty?

The code isn't on NPM lol. Of course, installing it and then importing it gives an error.

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.