JSPM

  • Created
  • Published
  • Downloads 618231
  • Score
    100M100P100Q173845F
  • License MIT

Natural language processor powered by plugins

Package Exports

  • retext

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (retext) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

retext Build Status Coverage Status Chat

The retext processor is a natural language processor powered by plug-ins.

Don’t need the parser, or another parser? That’s OK.

Installation

npm:

npm install retext

Usage

var retext = require('retext');
var profanities = require('retext-profanities');
var emoji = require('retext-emoji');
var report = require('vfile-reporter');

retext()
    .use(profanities)
    .use(emoji, {convert: 'encode'})
    .process('He’s set on beating your butt for sheriff! 👮', function (err, file) {
        file.filename = 'example';
        file.extension = 'txt';
        console.log(file.toString());
        console.error(report(file));
    });

Yields:

He’s set on beating your butt for sheriff! 👮
example.txt
    26-1:30  warning  Be careful with “butt”, it’s profane in some cases  butt

⚠ 1 warning

License

MIT © Titus Wormer