Propse a word when the input word is not in the dictionary
This module can be used to propse the right command in the scenario when there is a typo or mis-spell in the command line, it looks up the given dictionary and identifies the most similar word. It can also be used in any case that the string is formed by one or a series of known words, for example URL, directory path etc.
var propose = ;var dictionary = 'hello' 'world';var word = 'hallo';; //hello
threshold [0~1] specifies only the word with similarity equals to or higher than that value will be returned
var propose = ;var dictionary = 'aaaaaaaa' 'baabbbb' 'ccccc';var word = 'ab';; // null as the most similar word does not meet the threshold value
ignoreCase [true, false] specifies whether ignore case when comparing two words
var propose = ;var dictionary = 'HELLO' 'hallo';var word = 'hello';; //'HELLO'
mocha is installed globally
npm install mocha -g
npm test to run unit test