- int const word_ok = aspell_speller_check(m, word.c_str(), -1);
- LASSERT(word_ok != -1, /**/);
+ 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);