Skip to content

yefim/autocorrect

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

autocorrect Build Status

NPM

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

Usage

Default options (uses word-list as dict)

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

Contributors

Releases

No releases published

Packages

No packages published