GithubHelp home page GithubHelp logo

patrickarlt / retext-spell Goto Github PK

View Code? Open in Web Editor NEW

This project forked from retextjs/retext-spell

0.0 1.0 0.0 70 KB

plugin to check spelling

Home Page: https://unifiedjs.com

License: MIT License

JavaScript 100.00%

retext-spell's Introduction

retext-spell

Build Coverage Downloads Size Sponsors Backers Chat

retext plugin to check spelling (with nspell).

Install

npm:

npm install retext-spell

Use

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 documeant.', function(err, file) {
    console.error(report(err || file))
  })

Yields:

   1:6-1:12  warning  `useles` is misspelt; did you mean `useless`?      useles     retext-spell
  1:13-1:22  warning  `documeant` is misspelt; did you mean `document`?  documeant  retext-spell

⚠ 2 warnings

API

retext().use(spell, options)

retext-spell is async; use process, not processSync.

Check spelling (with nspell).

Signatures
  • retext().use(spell, dictionary)
  • retext().use(spell, options)
options.dictionary

A dictionary (Function). Result of requiring one of the dictionaries in wooorm/dictionaries.

options.personal

Personal dictionary (string or a Buffer in UTF-8, optional).

options.ignore

List of words to ignore (Array.<string>, default []).

options.ignoreLiteral

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

options.ignoreDigits

Whether to ignore “words” that contain only digits, such as 123456 (boolean?, default true).

options.normalizeApostrophes

Deal with apostrophes (boolean?, default true). Whether to swap smart apostrophes () with straight apostrophes (') before checking spelling. Dictionaries typically support this, but this option can be used if not.

options.max

Number of unique words to suggest for (number?, default 30). By default, up to thirty words are suggested for. Further misspellings are still warned about, but without suggestions. Increasing this number significantly impacts performance.

Messages

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

message.source

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

message.ruleId

Normalized not ok word (string, such as 'useles').

message.actual

Current not ok word (string, such as 'Useles').

message.expected

List of suggestions of words to use (Array.<string>, such as ['Useless']).

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-spell's People

Contributors

wooorm avatar localjo avatar raipc avatar janwirth avatar nodatall avatar tbroadley avatar

Watchers

James Cloos 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.