Comments (2)
Hi @wooorm , you are right. Thanks for your response and maintaining this awesome suite. It's simple and easy, the best library in JS ecosystem, and I've tested many.
Sorry for not giving too much context, I thought everyone was having the same issue. I use it using nspell
from you by loading it like this:
import nspell from 'nspell';
import englishLoader from 'dictionary-en';
import swedishLoader from 'dictionary-sv';
async function loadSpellCheckerAsync(lang) {
const builtInDict = await loadBuiltInDictionaryAsync(lang);
const spellChecker = new nspell(builtInDict);
return spellChecker;
}
function loadBuiltInDictionaryAsync(lang) {
const dictionaryLoader = getDictionaryLoader(lang);
return new Promise((resolve, reject) => {
dictionaryLoader((err, dict) => {
if (err) { reject(err); }
resolve(dict);
});
});
}
function getDictionaryLoader(lang){
switch(lang) {
case "en":
return englishLoader;
case "sv":
return swedishLoader;
default:
throw new Error(`Unsupported lang: ${lang}`);
}
}
I call loadSpellCheckerAsync
with en
and sv
. English loader works just fine and .correct
responds to my tokens, however swedish loader assumes everything is always correct.
from dictionaries.
Hey. This either has to do with the tool you are using or the upstream. More info is needed to debug, but it‘s most likely external.
from dictionaries.
Related Issues (20)
- arabic HOT 2
- Origin of Russian dictionaries? HOT 2
- Add type definitions HOT 1
- Convert to ESM HOT 6
- Add words to German dictionary HOT 4
- en_GB doesn't work for "misspelt" HOT 1
- Suggestion is not working for Swedish HOT 1
- [update word] Polish "przypuszczać - przypuszczający" HOT 1
- Investigate shipping `.dic`, `.aff` as JSON HOT 3
- [Question] Is there some index accross dictionaries ? HOT 1
- Simple code is not running HOT 4
- Force accents in Russian dictionary (ё) HOT 2
- Lithuanian dictionary is wrong HOT 2
- Use a newer, updated source for Russian HOT 4
- Korean returns true for all words (correct function) HOT 1
- Issue in Dictionary file - Different style apostrophes, it marks it as a misspelling HOT 2
- Add Swahili dictionaries HOT 1
- There should be no Eszett in Swiss German HOT 1
- Add index.dic and index.aff to exports HOT 7
- Html Entities found in `.aff` files. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dictionaries.