autocorrect

Find the best matching word using the first smallest Levenshtein distance

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
autocorrect
1.2.08 years ago8 years agoMinified + gzip package size for autocorrect in KB

Readme

autocorrect Build Status
NPM
Finds the best matching word using the first smallest Levenshtein distance.

Usage

Default options

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

Custom dictionary path

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

Custom words

```` javascript 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