/// the location below system/user directory
/// there the aff+dic files lookup will happen
- const string dictDirectory(void) { return "dict"; }
- const int maxLookupSelector(void) { return 3; }
+ const string dictDirectory(void) const { return "dict"; }
+ int maxLookupSelector(void) const { return 3; }
};
SpellChecker::Result HunspellChecker::check(WordLangTuple const & wl)
{
if (d->isIgnored(wl))
- return OK;
+ return WORD_OK;
Hunspell * h = d->speller(wl.lang()->code());
if (!h)
- return OK;
+ return WORD_OK;
int info;
string const encoding = h->get_dic_encoding();
string const word_to_check = to_iconv_encoding(wl.word(), encoding);
if (h->spell(word_to_check.c_str(), &info))
- return OK;
+ return WORD_OK;
if (info & SPELL_COMPOUND) {
// FIXME: What to do with that?
}
+void HunspellChecker::advanceChangeNumber()
+{
+ nextChangeNumber();
+}
+
+
void HunspellChecker::insert(WordLangTuple const & wl)
{
string const word_to_check = to_utf8(wl.word());
if (!h)
return;
h->add(word_to_check.c_str());
+ advanceChangeNumber();
}
void HunspellChecker::accept(WordLangTuple const & wl)
{
d->ignored_.push_back(wl);
+ advanceChangeNumber();
}