Spelling checker for retext
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.editorconfig
.gitignore
.travis.yml
LICENSE
index.js
package.json
readme.md
test.js

readme.md

retext-spell Build Status Coverage Status

Check spelling with 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');

retext()
  .use(spell, dictionary)
  .process('Some useles mispelt documeant.', function (err, file) {
    console.error(report(err || file));
  });

Yields:

   1:6-1:12  warning  `useles` is misspelt     retext-spell  retext-spell
  1:13-1:20  warning  `mispelt` is misspelt    retext-spell  retext-spell
  1:21-1:30  warning  `documeant` is misspelt  retext-spell  retext-spell

⚠ 3 warnings

API

retext().use(spell, dictionary|options)

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

Adds warnings for misspelt words to processed virtual files.

Parameters
  • dictionary (Function) — Result of requiring one of the dictionaries in wooorm/dictionaries;
  • options (Object):
    • dictionary — See above;
    • ignore (Array.<string>, default []) — 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, such as 123456;
    • max (number?, default 30) — Number of unique words to suggest for. By default, up to thirty words are suggested for. Further misspellings are still warned about, but without suggestions.

License

MIT © Titus Wormer