https://github.com/ccnokes/node-spellchecker
Fork of node-spellchecker that removes Hunspell due to legal issues that you probably don't have
https://github.com/ccnokes/node-spellchecker
Last synced: about 2 months ago
JSON representation
Fork of node-spellchecker that removes Hunspell due to legal issues that you probably don't have
- Host: GitHub
- URL: https://github.com/ccnokes/node-spellchecker
- Owner: ccnokes
- License: mit
- Created: 2018-04-30T22:34:54.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2023-10-05T17:42:59.000Z (over 2 years ago)
- Last Synced: 2025-02-19T11:15:26.351Z (over 1 year ago)
- Language: C++
- Homepage:
- Size: 2.26 MB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
### !!! Important note !!!
This is a fork of [node-spellchecker](https://github.com/atom/node-spellchecker), you probably want that one instead because it supports Windows 7 and Linux (via Hunspell). This one removes Hunspell due to issues my org has with it's license.
# SpellChecker Node Module
[](https://ci.appveyor.com/project/ccnokes/node-spellchecker)
[](https://travis-ci.org/ccnokes/node-spellchecker)
Native bindings to [NSSpellChecker](https://developer.apple.com/library/mac/#documentation/cocoa/reference/ApplicationKit/Classes/NSSpellChecker_Class/Reference/Reference.html) or the [Windows 8 Spell Check API](https://msdn.microsoft.com/en-us/library/windows/desktop/hh869853(v=vs.85).aspx), depending on your platform.
## Installing
```bash
npm install @ccnokes/spellchecker
```
## Using
```javascript
import { SpellChecker } from '@ccnokes/spellchecker'
```
### SpellChecker.isMisspelled(word)
Check if a word is misspelled.
`word` - String word to check.
Returns `true` if the word is misspelled, `false` otherwise.
### SpellChecker.getCorrectionsForMisspelling(word)
Get the corrections for a misspelled word.
`word` - String word to get corrections for.
Returns a non-null but possibly empty array of string corrections.
### SpellChecker.checkSpelling(corpus)
Identify misspelled words in a corpus of text.
`corpus` - String corpus of text to spellcheck.
Returns an Array containing `{start, end}` objects that describe an index range within the original String that contains a misspelled word.
### SpellChecker.checkSpellingAsync(corpus)
Asynchronously identify misspelled words.
`corpus` - String corpus of text to spellcheck.
Returns a Promise that resolves with the Array described by `checkSpelling()`.
### SpellChecker.add(word)
Adds a word to the dictionary.
When using Hunspell, this will not modify the .dic file; new words must be added each time the spellchecker is created. Use a custom dictionary file.
`word` - String word to add.
Returns nothing.
### SpellChecker.isSupported()
Tells if your platform is supported. If it's not, you can use the API as normal, just nothing will actually work.
Returns boolean.