+SpellChecker::Result AspellChecker::Private::check(
+ AspellSpeller * m, WordLangTuple const & word)
+ const
+{
+ SpellChecker::Result result = WORD_OK;
+ docstring w1;
+ LYXERR(Debug::GUI, "spellCheck: \"" <<
+ word.word() << "\", lang = " << word.lang()->lang()) ;
+ docstring rest = split(word.word(), w1, '-');
+ for (; result == WORD_OK;) {
+ string const word_str = toAspellWord(w1);
+ int const word_ok = aspell_speller_check(m, word_str.c_str(), -1);
+ LASSERT(word_ok != -1, return UNKNOWN_WORD);
+ result = (word_ok) ? WORD_OK : UNKNOWN_WORD;
+ if (rest.empty())
+ break;
+ rest = split(rest, w1, '-');
+ }
+ if (result == WORD_OK)
+ return result;
+ string const word_str = toAspellWord(word.word());
+ int const word_ok = aspell_speller_check(m, word_str.c_str(), -1);
+ LASSERT(word_ok != -1, return UNKNOWN_WORD);
+ return (word_ok) ? WORD_OK : UNKNOWN_WORD;
+}
+
+void AspellChecker::Private::accept(Speller & speller, WordLangTuple const & word)
+{
+ speller.ignored_words_.push_back(word.word());
+}
+
+
+/// personal word list interface
+void AspellChecker::Private::remove(WordLangTuple const & word)
+{
+ PersonalWordList * pd = personal_[word.lang()->lang()];
+ if (!pd)
+ return;
+ pd->remove(word.word());
+ Spellers::iterator it = spellers_.find(word.lang()->lang());
+ if (it != spellers_.end()) {
+ initSessionDictionary(it->second, pd);
+ }
+}
+
+
+void AspellChecker::Private::insert(WordLangTuple const & word)
+{
+ Spellers::iterator it = spellers_.find(word.lang()->lang());
+ if (it != spellers_.end()) {
+ addToSession(it->second.e_speller, word.word());
+ PersonalWordList * pd = personal_[word.lang()->lang()];
+ if (!pd)
+ return;
+ pd->insert(word.word());
+ }
+}
+
+bool AspellChecker::Private::learned(WordLangTuple const & word)