Spell-checker.js
Simple expandable tool for spell checking
Readme: English
Русский
Supported languages
- English
- Russian
Quickstart
Install:
npm i spell-checker-js
Code
const spell = // Load dictionaryspell // Checking textconst check = spell console// -> ['blahblahblah', 'olololo']
Methods & properties
spell.load(dictionary)
or spell.load(options)
— load dictionary file
Examples:
// ways for load default dictionary:spellspell // load custom dictionary with utf-8:spell // laod custom dictionary with charset:spell // Asynchronous load default dictionary:spell
List of default dictionaries:
en
— list of English wordsru
— list of Russian wordsru_surnames
— list of Russian surnames
You can help by adding other languages or expand existing dictionaries
spell.check(string)
— spell checking of text
Returns: array of wrong words
Example:
spell const check = spell console// -> ['blahblahblah', 'olololo']
spell.clear()
— clear all loaded dictionaries
Example:
spell spellclearspell // -> ERROR! Dictionaries are not loaded
spell.size
— number of words in the dictionary are
Example
spellspell console// -> 1956898
License
MIT © 2016 Danakt Frost