kjelsrud.dev/node_modules/retext/readme.md
2023-07-19 21:31:30 +02:00

5.4 KiB
Raw Blame History

retext

Build Coverage Downloads Size Sponsors Backers Chat

retext is a natural language processor powered by plugins part of the unified collective.

Dont need the parser? Or the compiler? Thats OK.

Sponsors

Support this effort and give back by sponsoring on OpenCollective!

Gatsby 🥇

Vercel 🥇

Netlify

Holloway

ThemeIsle

Boost Hub

Expo


You?

Install

npm:

npm install retext

Use

import {retext} from 'retext'
import retextProfanities from 'retext-profanities'
import retextEmoji from 'retext-emoji'
import {reporter} from 'vfile-reporter'

retext()
  .use(retextProfanities)
  .use(retextEmoji, {convert: 'encode'})
  .process('Hes set on beating your butt for sheriff! :cop:')
  .then((file) => {
    console.log(String(file))
    console.error(reporter(file))
  })

Yields:

Hes set on beating your butt for sheriff! 👮
  1:26-1:30  warning  Be careful with “butt”, its profane in some cases  butt  retext-profanities

⚠ 1 warning

Contribute

See contributing.md in retextjs/.github for ways to get started. See support.md for ways to get help. Ideas for new plugins and tools can be posted in retextjs/ideas.

A curated list of awesome retext resources can be found in awesome retext.

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