diff options
author | Dom Lachowicz <domlachowicz@gmail.com> | 2003-08-01 03:49:16 +0000 |
---|---|---|
committer | Dom Lachowicz <domlachowicz@gmail.com> | 2003-08-01 03:49:16 +0000 |
commit | 36f187622cb5b58687c3f193b48c73a11a4fb9c7 (patch) | |
tree | 2ccceceab9e5ba9cb11de914e45e75203044b642 /src/ispell/ispell_checker.cpp | |
parent | 352863a92b3af0ee60ee1228d03cbb42a7d1d269 (diff) | |
download | enchant-36f187622cb5b58687c3f193b48c73a11a4fb9c7.tar.gz |
implement front-level session and personal dictionary handling. fix some memory leaks. improve test suite
git-svn-id: svn+ssh://svn.abisource.com/svnroot/enchant/trunk@20782 bcba8976-2d24-0410-9c9c-aab3bd5fdfd6
Diffstat (limited to 'src/ispell/ispell_checker.cpp')
-rw-r--r-- | src/ispell/ispell_checker.cpp | 36 |
1 files changed, 2 insertions, 34 deletions
diff --git a/src/ispell/ispell_checker.cpp b/src/ispell/ispell_checker.cpp index 09154f0..2309852 100644 --- a/src/ispell/ispell_checker.cpp +++ b/src/ispell/ispell_checker.cpp @@ -32,6 +32,7 @@ #include <stdlib.h> #include <string.h> +#include <string> #include <vector> #include "sp_spell.h" @@ -222,13 +223,6 @@ ISpellChecker::checkWord(const char * const utf8Word, size_t length) if (!utf8Word || length >= (INPUTWORDLEN + MAXAFFIXLEN) || length == 0) return false; - std::string word (utf8Word, length); - - if (m_personal[word]) - return true; - if (m_session[word]) - return true; - bool retVal = false; if (!g_iconv_is_valid(m_translate_in)) @@ -536,31 +530,6 @@ ispell_dict_check (EnchantDict * me, const char *const word, size_t len) } static void -ispell_dict_add_to_personal (EnchantDict * me, - const char *const word, size_t len) -{ - ISpellChecker * checker; - - // emulate adding to a personal dictionary via a session-like - // interface - - checker = (ISpellChecker *) me->user_data; - checker->addToPersonal(word, len); -} - -static void -ispell_dict_add_to_session (EnchantDict * me, - const char *const word, size_t len) -{ - ISpellChecker * checker; - - // implement a session interface - - checker = (ISpellChecker *) me->user_data; - checker->addToSession(word, len); -} - -static void ispell_dict_free_suggestions (EnchantDict * me, char **str_list) { g_strfreev (str_list); @@ -588,9 +557,8 @@ ispell_provider_request_dict (EnchantProvider * me, const char *const tag) dict->user_data = (void *) checker; dict->check = ispell_dict_check; dict->suggest = ispell_dict_suggest; - dict->add_to_personal = ispell_dict_add_to_personal; - dict->add_to_session = ispell_dict_add_to_session; dict->free_suggestions = ispell_dict_free_suggestions; + // don't implement session or personal return dict; } |