pos_type const & first, pos_type const & last,
SpellChecker::Result result,
docstring const & word,
- SkipPositions const & skips,
- vector<WordLangTuple> const & docdict);
+ SkipPositions const & skips);
InsetCode ownerCode() const
{
pos_type const & first, pos_type const & last,
SpellChecker::Result result,
docstring const & word,
- SkipPositions const & skips,
- vector<WordLangTuple> const & docdict)
+ SkipPositions const & skips)
{
if (!SpellChecker::misspelled(result)) {
setMisspelled(first, last, SpellChecker::WORD_OK);
/// should not happen if speller supports range checks
if (!wlen)
continue;
- docstring const candidate = word.substr(wstart, wlen);
+ WordLangTuple const candidate(word.substr(wstart, wlen), lang);
wstart += first + numskipped;
if (snext < wstart) {
/// mark the range of correct spelling
}
snext = wstart + wlen;
// Check whether the candidate is in the document's local dict
- vector<WordLangTuple>::const_iterator iit = docdict.begin();
SpellChecker::Result actresult = result;
- for (; iit != docdict.end(); ++iit) {
- if (iit->lang()->code() != lang->code())
- continue;
- if (iit->word() == candidate) {
- actresult = SpellChecker::WORD_OK;
- break;
- }
- }
+ if (inset_owner_->buffer().params().spellignored(candidate))
+ actresult = SpellChecker::DOCUMENT_LEARNED_WORD;
numskipped += countSkips(it, et, snext);
/// mark the range of misspelling
setMisspelled(wstart, snext, actresult);
- if (actresult == SpellChecker::WORD_OK)
+ if (actresult == SpellChecker::DOCUMENT_LEARNED_WORD)
LYXERR(Debug::GUI, "local dictionary word: \"" <<
- candidate << "\" [" <<
+ candidate.word() << "\" [" <<
wstart << ".." << (snext-1) << "]");
else
LYXERR(Debug::GUI, "misspelled word: \"" <<
- candidate << "\" [" <<
+ candidate.word() << "\" [" <<
wstart << ".." << (snext-1) << "]");
++snext;
}
BufferParams const & bparams = d->inset_owner_->buffer().params();
SpellChecker::Result result = !word.empty() ?
speller->check(wl, bparams.spellignore()) : SpellChecker::WORD_OK;
- d->markMisspelledWords(lang, first, last, result, word, skips,
- bparams.spellignore());
+ d->markMisspelledWords(lang, first, last, result, word, skips);
first = ++last;
}
} else {