+Hunspell * HunspellChecker::Private::lookup(Language const * lang)
+{
+ Spellers::iterator it = spellers_.find(lang->lang());
+ return it != spellers_.end() ? it->second : nullptr;
+}
+
+
+Hunspell * HunspellChecker::Private::addSpeller(Language const * lang, string & path)
+{
+ if (!haveDictionary(lang, path)) {
+ spellers_[lang->lang()] = nullptr;
+ return nullptr;
+ }
+
+ FileName const affix(path + ".aff");
+ FileName const dict(path + ".dic");
+ Hunspell * h = new Hunspell(affix.absFileName().c_str(), dict.absFileName().c_str());
+ LYXERR(Debug::FILES, "Hunspell speller for langage " << lang << " at " << dict << " added.");
+ spellers_[lang->lang()] = h;
+ return h;
+}
+
+
+Hunspell * HunspellChecker::Private::addSpeller(Language const * lang)
+{
+ Hunspell * h = nullptr;
+ for (int p = 0; p < maxLookupSelector() && nullptr == h; ++p) {
+ string lpath = dictPath(p);
+ h = addSpeller(lang, lpath);
+ }
+ if (h) {
+ string const encoding = h->get_dic_encoding();
+ PersonalWordList * pd = new PersonalWordList(lang->lang());
+ pd->load();
+ personal_[lang->lang()] = pd;
+ docstring_list::const_iterator it = pd->begin();
+ docstring_list::const_iterator et = pd->end();
+ for (; it != et; ++it) {
+ string const word_to_add = to_iconv_encoding(*it, encoding);
+ h->add(word_to_add.c_str());
+ }
+ }
+ return h;
+}
+
+
+int HunspellChecker::Private::numDictionaries() const