Giter VIP home page Giter VIP logo

retext-profanities's Introduction

retext-profanities

Build Coverage Downloads Size Sponsors Backers Chat

retext plugin to check for profane and vulgar wording. Uses cuss for sureness.

Install

npm:

npm install retext-profanities

Use

Say we have the following file, example.txt:

He’s pretty set on beating your butt for sheriff.

…and our script, example.js, looks like this:

var vfile = require('to-vfile')
var report = require('vfile-reporter')
var unified = require('unified')
var english = require('retext-english')
var stringify = require('retext-stringify')
var profanities = require('retext-profanities')

unified()
  .use(english)
  .use(profanities)
  .use(stringify)
  .process(vfile.readSync('example.txt'), function(err, file) {
    console.error(report(err || file))
  })

Now, running node example yields:

example.txt
  1:33-1:37  warning  Be careful with “butt”, it’s profane in some cases  butt  retext-profanities

⚠ 1 warning

API

retext().use(profanities[, options])

check for profane and vulgar wording. Uses cuss for sureness.

options.ignore

Phrases not to warn about (Array.<string>, default: []).

options.sureness

Minimum sureness to warn about, see cuss (number, default: 0).

Rules

See rules.md for a list of rules.

Note that Latin-script Arabic (retext-profanities/ar-latn), French (retext-profanities/fr), Spanish (retext-profanities/es), Italian (retext-profanities/it), and Brazilian Portuguese (retext-profanities/pt-br) are also supported.

Messages

See rules.md for a list of rules and how rules work.

Each message is emitted as a VFileMessage on file, with the following fields:

message.source

Name of this plugin ('retext-profanities').

message.ruleId

See id in rules.md.

message.profanitySeverity

Cuss sureness (number).

message.actual

Profane phrase (string).

message.expected

Empty array to signal that actual should be removed or changed ([]).

Related

Contribute

See contributing.md in retextjs/.github for ways to get started. See support.md for ways to get help.

This project has a code of conduct. By interacting with this repository, organization, or community you agree to abide by its terms.

License

MIT © Titus Wormer

retext-profanities's People

Contributors

wooorm avatar greenkeeperio-bot avatar mansona avatar cynferdd avatar mukeshyadav-in avatar otacilion avatar nodatall avatar

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.