UNPKG

568 BMarkdownView Raw
1## Usage
2
3### Default options
4
5````javascript
6var autocorrect = require('autocorrect')()
7autocorrect('mbryo') // embryo
8````
9
10### Custom dictionary path
11
12````javascript
13var path = '/usr/share/dict/words'
14var autocorrect = require('autocorrect')({dictionary: path})
15autocorrect('mbryo') // embryo
16````
17
18### Custom words
19```` javascript
20var words = ['word', 'weird', 'wired']
21var autocorrect = require('autocorrect')({words: words})
22autocorrect('wared') // wired
23````
24
25## Options
26
27* `words` - a list of words to use for matching
28* `dictionary` - path to dictionary file
29
\No newline at end of file