X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FHunspellChecker.cpp;h=67c7e27cc422fc93fde4e1b8aaf639f8590333d4;hb=ecdeffb52b1dad2f56e0e4210d0a040e807e2caf;hp=31b629671e653350e1b00a857fc022d0e5e756ba;hpb=6b2232a29c682d8e62d1d2b963bb1a70bee4330b;p=lyx.git diff --git a/src/HunspellChecker.cpp b/src/HunspellChecker.cpp index 31b629671e..67c7e27cc4 100644 --- a/src/HunspellChecker.cpp +++ b/src/HunspellChecker.cpp @@ -83,15 +83,18 @@ struct HunspellChecker::Private /// the location below system/user directory /// there the aff+dic files lookup will happen const string dictDirectory(void) const { return "dicts"; } - int maxLookupSelector(void) const { return 4; } + int maxLookupSelector(void) const { return 5; } const string HunspellDictionaryName(Language const * lang) { return lang->variety().empty() ? lang->code() : lang->code() + "-" + lang->variety(); } - const string osPackageDictDirectory(void) { + const string myspellPackageDictDirectory(void) { return "/usr/share/myspell"; } + const string hunspellPackageDictDirectory(void) { + return "/usr/share/hunspell"; + } }; @@ -150,15 +153,14 @@ bool HunspellChecker::Private::haveLanguageFiles(string const & hpath) const string HunspellChecker::Private::dictPath(int selector) { switch (selector) { + case 4: + return addName(hunspellPackageDictDirectory(),dictDirectory()); case 3: - return addName(osPackageDictDirectory(),dictDirectory()); - break; + return addName(myspellPackageDictDirectory(),dictDirectory()); case 2: return addName(package().system_support().absFileName(),dictDirectory()); - break; case 1: return addName(package().user_support().absFileName(),dictDirectory()); - break; default: return user_path_; } @@ -344,16 +346,18 @@ SpellChecker::Result HunspellChecker::check(WordLangTuple const & wl) string const encoding = h->get_dic_encoding(); string const word_to_check = to_iconv_encoding(wl.word(), encoding); + LYXERR(Debug::GUI, "spellCheck: \"" << + wl.word() << "\", lang = " << wl.lang()->lang()) ; if (h->spell(word_to_check.c_str(), &info)) return d->learned(wl) ? LEARNED_WORD : WORD_OK; if (info & SPELL_COMPOUND) { // FIXME: What to do with that? - LYXERR(Debug::FILES, "Hunspell compound word found " << word_to_check); + LYXERR(Debug::GUI, "Hunspell compound word found " << word_to_check); } if (info & SPELL_FORBIDDEN) { // This was removed from personal dictionary - LYXERR(Debug::FILES, "Hunspell explicit forbidden word found " << word_to_check); + LYXERR(Debug::GUI, "Hunspell explicit forbidden word found " << word_to_check); } return UNKNOWN_WORD;