///
AspellSpeller * speller(Language const * lang);
- /// create a unique ID from lang code and variety
- string const spellerID(Language const * lang);
-
bool isValidDictionary(AspellConfig * config,
string const & lang, string const & variety);
bool checkAspellData(AspellConfig * config,
/// the location below system/user directory
/// there the rws files lookup will happen
- const string dictDirectory(void) { return "dict"; }
+ const string dictDirectory(void) { return "dicts"; }
/// there the dat+cmap files lookup will happen
const string dataDirectory(void) { return "data"; }
/// os package directory constants
initSessionDictionary(m, pd);
}
- spellers_[spellerID(lang)] = m;
+ spellers_[lang->lang()] = m;
return m.e_speller ? to_aspell_speller(m.e_speller) : 0;
}
AspellSpeller * AspellChecker::Private::speller(Language const * lang)
{
- Spellers::iterator it = spellers_.find(spellerID(lang));
+ Spellers::iterator it = spellers_.find(lang->lang());
if (it != spellers_.end())
return to_aspell_speller(it->second.e_speller);
}
-string const AspellChecker::Private::spellerID(Language const * lang)
-{
- return lang->code() + "-" + lang->variety();
-}
-
-
SpellChecker::Result AspellChecker::Private::check(
AspellSpeller * m, string const & word)
const
if (!pd)
return;
pd->remove(word.word());
- Spellers::iterator it = spellers_.find(spellerID(word.lang()));
+ 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(spellerID(word.lang()));
+ Spellers::iterator it = spellers_.find(word.lang()->lang());
if (it != spellers_.end()) {
AspellSpeller * speller = to_aspell_speller(it->second.e_speller);
aspell_speller_add_to_session(speller, to_utf8(word.word()).c_str(), -1);
void AspellChecker::accept(WordLangTuple const & word)
{
- Spellers::iterator it = d->spellers_.find(d->spellerID(word.lang()));
+ Spellers::iterator it = d->spellers_.find(word.lang()->lang());
if (it != d->spellers_.end()) {
AspellSpeller * speller = to_aspell_speller(it->second.e_speller);
aspell_speller_add_to_session(speller, to_utf8(word.word()).c_str(), -1);