npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@tekdi/multilingual-profanity-filter

v1.0.1

Published

A multilingual profanity filter library for React applications.

Downloads

39

Readme


Profanity Filter Library

A versatile library for filtering out profanity words in various languages. This library helps in cleaning up text by detecting and replacing inappropriate words based on configurable language codes.

Features

  • Multilingual Support: Includes profanity lists for multiple languages.
  • Customizable: Easy to extend with additional languages and words.
  • Flexible Filtering: Can be integrated into various applications to ensure clean and appropriate content.

Installation

To use the library, you can install it via npm:

npm install @tekdi/multilingual-profanity-filter

Usage

Basic Usage

  1. Import the Library

    import { filterBadWords } from '@tekdi/multilingual-profanity-filter';
  2. Filter Text

    Use the filterBadWords function to filter out profanity from a given text. You need to provide the text and the language code for filtering.

    const inputText = "I am so tired of these idiots. This is complete bullshit";
    const languageCode = "en"; // Use "en" for English
    
    const filteredText = filterBadWords(inputText, languageCode);
    
    console.log(filteredText);
    // Expected Output: "I am so tired of these i****. This is complete b****ts"

Supported Languages

Currently, the library supports the following languages:

  • English (en)
  • Hindi (hi)
  • Marathi (mr)
  • Tamil (ta)
  • Gujarati (gu)
  • Kannada (kn)

To add support for additional languages, you can extend the badWords.json file with the desired language's profanity list.

Configuration

To configure or add new languages, modify the badWords.json file located in the Badwords directory. The file should be structured as follows:

{
  "en": ["badword1", "badword2"],
  "hi": ["गाली1", "गाली2"],
  "mr": ["गालिच्या शब्द1", "गालिच्या शब्द2"],
  "ta": ["பொய்யான சொல்1", "பொய்யான சொல்2"],
  "gu": ["ગંદી શબ્દ1", "ગંદી શબ્દ2"],
  "kn": ["ಕಿಡಿ ಶಬ್ದ1", "ಕಿಡಿ ಶಬ್ದ2"]
}

Contributing

We welcome contributions to this project! Follow the steps below to get started:

  1. Fork the Repository: Click the "Fork" button at the top right corner of the repository page.

  2. Clone the Repository: Use the following command to clone the repository to your local machine.

    git clone https://github.com/Sunbird-ALL/all-multilingual-profanity-filter.git
  3. Navigate to the Project Directory:

    cd all-multilingual-profanity-filter
  4. Create a New Branch: Create a new branch for your feature or bugfix.

    git checkout -b feature/your-feature-name
  5. Make Changes: Implement your feature or bugfix.

  6. Commit Your Changes: Commit your changes with a descriptive commit message.

    git commit -m "Add feature: description of the feature"
  7. Push to Your Branch:

    git push origin feature/your-feature-name
  8. Submit a Pull Request: Go to the original repository and click "New Pull Request".

License

This library is licensed under the MIT License.

Contact

For any questions or support, please contact Ajinkya Pande.