GitbookIO / hunspell-spellchecker

Parse and use Hunspell dictionaries in Javascript
Apache License 2.0
77 stars 17 forks source link

Allow to give several dictionaries to parse #6

Open yannickglt opened 8 years ago

yannickglt commented 8 years ago

Adding several dictionaries would look like:

// Parse an hunspell dictionary that can be serialized as JSON
var DICT = spellchecker.parse([
  {
    aff: fs.readFileSync("./en_EN.aff"),
    dic: fs.readFileSync("./en_EN.dic")
  }, {
    dic: fs.readFileSync("./fr_FR.dic")
  }, {
    dic: fs.readFileSync("./custom_dictionary.dic")
  }
]);

What do you think about this possibility?

yannickglt commented 8 years ago

@SamyPesse If you think it is a good idea, I can make a PR.