autocorrect

1.2.0 • Public • Published

autocorrect Build Status

NPM

Finds the best matching word using the first smallest Levenshtein distance.

Usage

Default options

var autocorrect = require('autocorrect')()
autocorrect('mbryo') // embryo

Custom dictionary path

var path = '/usr/share/dict/words'
var autocorrect = require('autocorrect')({dictionary: path})
autocorrect('mbryo') // embryo

Custom words

var words = ['word', 'weird', 'wired']
var autocorrect = require('autocorrect')({words: words})
autocorrect('wared') // wired

Options

  • words - a list of words to use for matching
  • dictionary - path to dictionary file

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.2.0
    768
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.2.0
    768
  • 1.1.0
    1
  • 1.0.0
    1

Package Sidebar

Install

npm i autocorrect

Weekly Downloads

608

Version

1.2.0

License

MIT

Last publish

Collaborators

  • yefim