Coder Social home page Coder Social logo

cuss's Introduction

cuss

Build Coverage Downloads Size

Map of profanities, slurs, and obscenities to a sureness rating.

Contents

What is this?

This package exposes lists of profane words in several languages. This rating does not represent how vulgar a term is. It represents how likely it is to be used as either profanity or clean text.

When should I use this?

Use this for researching natural language. Don’t use it to make a “profanity filter”. Those are bad.

Install

This package is ESM only. In Node.js (version 14.14+, 16.0+), install with npm:

npm install cuss

In Deno with esm.sh:

import {cuss} from 'https://esm.sh/cuss@2'

In browsers with esm.sh:

<script type="module">
  import {cuss} from 'https://esm.sh/cuss@2?bundle'
</script>

Use

import {cuss} from 'cuss'
import {cuss as cussPt} from 'cuss/pt'

console.log(Object.keys(cuss).length) // 1776
console.log(Object.keys(cussPt).length) // 173

console.log(cuss.beaver) // 0
console.log(cuss.asshat) // 2

console.log(cussPt.burro) // 1
console.log(cussPt.bixa) // 2

API

cuss exports the following entries:

  • cuss — English
  • cuss/ar-latn — Arabic (Latin)
  • cuss/es — Spanish
  • cuss/fr — French
  • cuss/it — Italian
  • cuss/pt — Portuguese
  • cuss/pt-pt — European Portuguese

Each entry exports the identifier cuss. There are no default exports.

cuss

Map of offensive words to a sureness rating (Record<string, number>).

Each rating is a number between 0 and 2 (both including), representing the certainty the key is used as a profanity depending on context.

Rating Use as a profanity Use in clean text Example
2 likely unlikely asshat
1 maybe maybe addict
0 unlikely likely beaver

Data

Types

This package is fully typed with TypeScript. It exports no additional types.

Compatibility

This package is at least compatible with all maintained versions of Node.js. As of now, that is Node.js 14.14+ and 16.0+. It also works in Deno and modern browsers.

Related

  • buzzwords — list of buzzwords
  • dale-chall — list of familiar American-English words (1995)
  • fillers — list of filler words
  • hedges — list of hedge words
  • profanities — list of the same profane words, but without the sureness
  • spache — list of simple American-English words (1974)
  • weasels — list of weasel words

Contributing

Yes please! See How to Contribute to Open Source.

New terms can be added to the corresponding files as listed in the support section.

To add a new language, create a new JS file with a BCP 47 language tag as its name (lower case, dashes, and preferred and normalized).

After changing something, run npm install to install all required dependencies, then npm test to update: the project includes some scripts to make sure everything is in order. Note that the tests require Node.js 18.0+. Finally, open a pull request.

Security

This package is safe.

License

MIT © Titus Wormer

cuss's People

Contributors

agauepi avatar ahmedredaamin avatar cynferdd avatar gledsonafonso avatar greenkeeperio-bot avatar integralleft avatar kaiserburger avatar leodau avatar martinbutt avatar mrbenj avatar namadnuno avatar otacilion avatar richardlitt avatar s-dimaria avatar tiny-crab avatar wooorm 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

cuss's Issues

Cummings is a street in my area

Cummings, which gets a 2 here and shows up as an error in Alex, is the name of a street in my area and a fairly uncommon, but known, last name. Can we make that word a 1, or in some other fashion make the plural OK, but the singular a 2?

Should we write a line explaining how to use cuss in another languages?

I am a beginner in JavaScript and I had some difficulties now about how to use the API in another language, in my case, import the cuss in pt-br.

Until I figure out that I needed to import using:

var cuss = require("cuss/pt-br");

So should we add in the README.md some explanation about how to use the API in languages different than English?

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.