Giter VIP home page Giter VIP logo

google-profanity-words's Introduction

alt text

Description

Full list of bad words and top swear words banned by Google. The list is updated monthly. Pull requests are welcome!

The @coffeeandfun/google-profanity-words is a Node.js module created by Robert James Gabriel from Coffee & Fun LLC. It is designed to help you identify and manage profanity words in a given text. The module provides functions to retrieve a list of all known profanity words, check if a specific word is considered profane, and handle empty strings appropriately.

Installation

You can install the @coffeeandfun/google-profanity-words module using npm:

npm install @coffeeandfun/google-profanity-words

Usage

To use the @coffeeandfun/google-profanity-words, first, import the module and create an instance:

import { ProfanityEngine } from '@coffeeandfun/google-profanity-words';

// Pass the 'language' parameter to specify the language (optional).
// Defaults to 'en' if no valid language code is provided.
const profanity = new ProfanityEngine({ language: 'es' });

The language parameter is optional and can be used to specify the language for the profanity list. It defaults to 'en' if no valid language code is provided. If the specified language file is not found, it will fall back to the 'en' language file and display a console warning.

API Functions

1. all()

Retrieves all the profanity words as an array.

const allWords = await profanity.all();

2. search(word)

Checks if a given word is considered profane.

const searchWord = await profanity.search('shit');
// Returns true if the word is profane, otherwise false.

3. hasCurseWords(sentence)

Checks if a given sentence contains any profanity words.

const sentence = 'Do not use bad words like mierda or idiota.';
const hasCurseWords = await profanity.hasCurseWords(sentence);
// Returns true if the sentence contains profanity words, otherwise false.

4. Handling Empty Strings

The search and hasCurseWords functions will return false for any empty string.

const searchWord = await profanity.search('');
const hasCurseWords = await profanity.hasCurseWords('');
// Returns false for an empty string.

Testing

The @coffeeandfun/google-profanity-words comes with a test suite using the Jest framework. To run the tests, use the following command:

npm test

Contributing

Contributions to this module are welcome! If you find any issues or have suggestions for improvements, feel free to open an issue or create a pull request on the GitHub repository.

License

This project is licensed under the MIT License.

Acknowledgments

Special thanks to Robert James Gabriel and Coffee & Fun LLC for creating and maintaining this module, as well as the Jest team for the testing framework. Your efforts make this module more reliable and robust.


google-profanity-words's People

Contributors

absorpheus avatar jpbm135 avatar kevinji avatar meotimdihia avatar mlaplante avatar robertjgabriel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

google-profanity-words's Issues

Feature Request : Search the whole sentence or paragraph

I am not sure how is the .search function intended to be used. Currently, it cannot be used to check a sentence whether it contains cursed words or not. Searching only one word does not help much. I think I can loop through each word and call the .search function on each one but it should be already in the package.

Remove duplicates

Firstly, thank you for maintaining this project.

The following words occur twice in the list, which is unnecessary.

  • cocksuck
  • cocksucked
  • cuntlick
  • cuntlicker
  • cuntlicking
  • gangbanged
  • jiz
  • jizm
  • orgasim
  • pissin
  • pissoff
  • shitty

I would have removed them myself and created a merge request, but I don't want this repository to appear on my profile. 😅

Thanks!

Is this a profanity word?

Can you please explain why the word "God" is considered a profanity word?

The following may be useful:

Word: Profanity

Origin

  • mid 16th century: from late Latin profanitas, from Latin profanus ‘not sacred’

Dictionary:

  • blasphemous or obscene language
  • a swear word
  • irreligious or irreverent behaviour

Thesauras:

  • oath, swear word, expletive, curse, obscenity, four-letter word, dirty word, execration, imprecation; blasphemy, swearing, foul language, bad language, cursing

  • idolatry, sacrilege, irreligiousness, ungodliness, impiety, unholiness, profaneness, blasphemy, irreverence, disrespectfulness, disrespect.

Word: God

Dictionary

  • (in Christianity and other monotheistic religions) the creator and ruler of the universe and source of all moral authority; the supreme being.
  • (god) (in certain other religions) a superhuman being or spirit worshipped as having power over nature or human fortunes; a deity: a moon god | the Hindu god Vishnu.

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.