forked from swyphcosmo/vscode-spellchecker
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
"fr" language support (incl. single quotes) + faster spellcheck <= re…
…placed hunspell-spellcheck submodule with spellchecker npm module
- Loading branch information
1 parent
6239911
commit 66b18ef
Showing
5 changed files
with
35 additions
and
19 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
Submodule hunspell-spellchecker
deleted from
8342d1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
var SpellChecker = require('spellchecker'); | ||
|
||
//console.log('dictionaries:', SpellChecker.getAvailableDictionaries()); | ||
|
||
var dics = [ 'en', 'fr' ]; | ||
var words = [ 'j\'aime', 'statement' ]; | ||
|
||
const checkWord = word => { | ||
var miss = SpellChecker.isMisspelled(word); | ||
var corr = SpellChecker.getCorrectionsForMisspelling(word); | ||
console.log('word: "' + word + '" is', | ||
miss ? 'misspelled => suggestions:' : 'correct :-)', | ||
miss ? corr.join(' / ') : ''); | ||
}; | ||
|
||
const testWithDic = dic => { | ||
console.log(' === dictionary:', dic, '\n'); | ||
SpellChecker.setDictionary(dic); | ||
words.forEach(checkWord); | ||
console.log(); | ||
}; | ||
|
||
dics.forEach(testWithDic); |