atom / node-spellchecker

SpellChecker Node Module
http://atom.github.io/node-spellchecker
MIT License
298 stars 106 forks source link

Mixed Language Support #103

Open ccorcos opened 5 years ago

ccorcos commented 5 years ago

It would be really sweet, if this library (as well as electron.webframe.setSpellCheckProvider) supported mixed languages. Chrome does a really good job with this already.

dmoonfire commented 5 years ago

What do you mean by mixed language? Using English and German at the same time? That functionality is part of the locales setting in the main configuration (you can put the simplified IEFT tag as a comma-separated list). Or is it a specific handling of different languages?

ccorcos commented 5 years ago

Interesting, so this would supposedly work?

const { webFrame } = require('electron')
webFrame.setSpellCheckProvider('en,de', true, {
  spellCheck (text) {
    return !(require('spellchecker').isMisspelled(text))
  }
})
dmoonfire commented 5 years ago

Sorry, I was thinking of the other spell check. When using this library, you can create two instances and point each one to a different dictionary file. Then you can check one and then the other. It doesn't use webFrame at all, mainly because it was written as a standalone app (direct in node).

ccorcos commented 5 years ago

I see. spellchecker.setDictionary and then spellchecker.isMisspelled for each language.