Skip to content

bkeepers/retext-spell

 
 

Repository files navigation

retext-spell Build Status Coverage Status

Spelling checker for retext.

Installation

npm:

npm install retext-spell

Usage

var retext = require('retext');
var spell = require('retext-spell');
var dictionary = require('dictionary-en-gb');
var report = require('vfile-reporter');
var doc = 'Some useles mispelt documeant.';

retext().use(spell, dictionary).process(doc, function (err, file) {
    if (err) throw err;
    console.log(report(file));
});

Yields:

<stdin>
   1:6-1:12  warning  useles is misspelled                                    spelling
  1:13-1:20  warning  mispelt is misspelled                                   spelling
  1:21-1:30  warning  documeant is misspelled                                 spelling

⚠ 3 warnings

API

retext.use(spell, options)

retext-spell is async; use the async form of retext.process.

Adds warnings for misspelt words to processed virtual files.

Signatures

  • use(plugin, dictionary);
  • use(plugin, options).

Parameters

  • spell — This plug-in.

  • dictionary (Function) — The result of requiring one of the dictionaries in wooorm/dictionaries;

  • options (Object):

    • dictionary — See above;

    • ignore (array?, default null) — List of words to ignore.

    • ignoreLiteral (boolean?, default true) — Whether to ignore literal words.

    • ignoreDigits (boolean?, default true) — Whether to ignore "words" that contain only digits, i.e. 123456.

License

MIT © Titus Wormer

About

Spelling checker for retext

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%