• Stars
    star
    160
  • Rank 234,703 (Top 5 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 8 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

🤬 Map of profane words to a rating of sureness

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

More Repositories

1

moby

📕 The largest English-language thesaurus
JavaScript
259
star
2

syllable

Count syllables in an English word
JavaScript
208
star
3

an-array-of-english-words

List of ~275,000 English words
JavaScript
197
star
4

stemmer

Fast Porter stemmer implementation
JavaScript
124
star
5

emoji-emotion

List of emoji rated for valence
JavaScript
122
star
6

profanities

🤬 List of (possible) profane words
JavaScript
97
star
7

english-words-that-are-not-yet-npm-packages

A CLI for finding available package names in the npm registry
JavaScript
83
star
8

double-metaphone

Fast Double Metaphone algorithm
JavaScript
79
star
9

n-gram

Get n-grams from text
JavaScript
73
star
10

similarity

How similar are these two strings?
JavaScript
71
star
11

flesch-kincaid

Formula to detect the grade level of text according to Flesch–Kincaid Grade Level (1975)
JavaScript
71
star
12

levenshtein-edit-distance

Levenshtein edit distance
JavaScript
63
star
13

cmu-pronouncing-dictionary

The 134,000+ words and their pronunciations in the CMU pronouncing dictionary
JavaScript
59
star
14

buzzwords

List of (possible) English buzzword words
JavaScript
53
star
15

an-array-of-french-words

List of ~336,000 French words
JavaScript
52
star
16

powerthesaurus-api

Look up English synonyms, antonyms, etc with powerthesaurus.org
JavaScript
52
star
17

automated-readability

Formula to detect ease of reading according to the Automated Readability Index (1967)
JavaScript
51
star
18

polarity

Detect the polarity (sentiment) of text
JavaScript
50
star
19

wordnet

Node module wrapper for WordNet dictionary.
JavaScript
50
star
20

dice-coefficient

Sørensen–Dice coefficient
JavaScript
48
star
21

color-description

Color-Description turns a technical color representation into a human readable description.
JavaScript
44
star
22

afinn-111

AFINN 111 (list of English words rated for valence) in JSON
JavaScript
43
star
23

metaphone

Fast Metaphone implementation
JavaScript
42
star
24

hedges

List of (possible) English hedge words
JavaScript
41
star
25

fillers

List of (possible) English filler words
JavaScript
40
star
26

ap-style-title-case

Convert a value to AP/APA title case
JavaScript
38
star
27

afinn-165

AFINN 165 (list of English words rated for valence) in JSON
JavaScript
38
star
28

rhymes

Give me an English word and I’ll give you a list of rhymes
JavaScript
38
star
29

an-array-of-spanish-words

List of ~636,000 Spanish words
JavaScript
38
star
30

weasels

List of (possible) English weasel words
JavaScript
34
star
31

soundex-code

Soundex phonetic algorithm
JavaScript
34
star
32

wiktionary

Look up words on wiktionary.org in English or any other language.
JavaScript
33
star
33

flesch

Formula to detect the ease of reading a text according to Flesch Reading Ease (1975)
JavaScript
31
star
34

dale-chall-formula

Formula to find the grade level according to the (revised) Dale–Chall Readability Formula (1995)
JavaScript
31
star
35

dale-chall

List of easy American-English words: The New Dale-Chall (1995)
JavaScript
31
star
36

similar-english-words

Give me a word and I’ll give you an array of words that differ by a single letter.
JavaScript
30
star
37

lancaster-stemmer

Lancaster stemming algorithm
JavaScript
29
star
38

subtlex-word-frequencies

A list of words from the SUBTLEX movie subtitles corpus, sorted by frequency.
JavaScript
28
star
39

wikipedia-tldr

⚡️Grab the first paragraph of any Wikipedia page
JavaScript
26
star
40

brill

Part-of-speech tags from the Brill-tagger
JavaScript
21
star
41

gunning-fog

Formula to detect the ease of reading a text according to the Gunning fog index (1952)
JavaScript
18
star
42

ord

🌎 Translate words using Wikipedia data
JavaScript
17
star
43

smog-formula

Formula to detect the ease of reading a text according to the SMOG (Simple Measure of Gobbledygook) formula (1969)
JavaScript
17
star
44

levenmorpher

Morph one word into another, one letter at a time
JavaScript
16
star
45

wikipedia-hyperlinks

Give me a term and I'll give you a list of links found in its Wikipedia article
JavaScript
15
star
46

ologies

A list of 500 -ology words and their meanings.
JavaScript
14
star
47

spache

List of familiar American-English words: The Revised Spache (1974)
JavaScript
14
star
48

coleman-liau

Formula to detect the ease of reading a text according to the Coleman-Liau index (1975)
JavaScript
14
star
49

google-did-you-mean

Fetch Google search suggestions for misspelled queries by scraping for 'Did you mean...' and 'Showing results for...' links.
JavaScript
10
star
50

spache-formula

Formula to detect the grade level of text according to the (revised) Spache Readability Formula (1974)
JavaScript
10
star
51

tree-names

🌳 Common names for trees
JavaScript
8
star
52

russian-given-names

🇷🇺👨👩 Russian given masculine and feminine names
JavaScript
7
star
53

japanese-characters

Analyze strings to detect if they contain Japanese characters.
JavaScript
7
star
54

english-anagrams

Find anagrams for English words. Works offline.
JavaScript
7
star
55

afinn-96

AFINN 96 (list of English words rated for valence) in JSON
JavaScript
6
star
56

english-bigrams

Letter pairs sorted by how frequently they appear in English words
JavaScript
6
star
57

rhymes-api

A webservice that dishes out rhymes
JavaScript
4
star
58

wikipedia-titles

A stream of 13 million English Wikipedia article titles. Use in node or on the command line.
JavaScript
4
star