34 AspellConfig* fconfig;
36 AspellSpeller* fspeller;
42 std::string fencoding;
51 void checkError()
throw( std::runtime_error );
59 void checkConfigError()
throw( std::runtime_error );
70 void init(
const std::string& lang,
const std::string& jargon,
71 const std::string& encoding)
72 throw( std::invalid_argument, std::runtime_error );
81 void printWordList(
const AspellWordList* wlist,
82 char delim=
'\n')
throw(std::invalid_argument);
90 void setConfig()
throw( std::invalid_argument );
99 void storeWordList(
const AspellWordList* wlist,
100 std::vector<std::string>& replacement)
101 throw( std::invalid_argument );
132 Suggest(
const std::string& lang=kDEF_LANG,
133 const std::string& jargon=kDEF_JARGON,
134 const std::string& encoding=kDEF_ENCODING)
135 throw(
std::invalid_argument,
std::runtime_error );
145 Suggest(const AspellDictInfo* dinfo,
146 const
std::
string& encoding=kDEF_ENCODING)
147 throw(
std::invalid_argument,
std::runtime_error );
156 throw(
std::runtime_error );
172 std::vector<
std::
string>& replacement,
173 bool always=true) throw(
std::invalid_argument );
197 std::vector<
std::
string>& vals);
206 throw(
std::runtime_error );
254 throw(
std::invalid_argument );
264 throw(
std::invalid_argument,
std::runtime_error );
276 const
std::
string& jargon,
277 const
std::
string& encoding=kDEF_ENCODING)
278 throw(
std::invalid_argument,
std::runtime_error );
296 throw(
std::invalid_argument );
305 throw(
std::invalid_argument );
314 throw(
std::invalid_argument );
323 throw(
std::invalid_argument );
327 #endif // #ifndef SUGGEST_H
bool checkWord(const std::string &word)
Spell-checks 'word'.
Definition: suggest.cpp:247
void StoreSessionList(std::vector< std::string > &replacement)
Stores session word list.
Definition: suggest.cpp:563
void printPersonalList()
Prints personal word list.
Definition: suggest.cpp:372
static const char * kDEF_ENCODING
Default character encoding for words.
Definition: suggest.h:117
Suggest(const std::string &lang=kDEF_LANG, const std::string &jargon=kDEF_JARGON, const std::string &encoding=kDEF_ENCODING)
Default constructor for spell-checking class.
Definition: suggest.cpp:190
void addPersonalList(const std::string &word)
Adds 'word' to personal list.
Definition: suggest.cpp:228
void clearSessionList()
Clears the current session word list.
Definition: suggest.cpp:304
void ignoreWord(const std::string &word)
Ignores 'word' for current session.
Definition: suggest.cpp:342
void listDicts(std::vector< AspellDictInfo > &vals)
Obtains list of available aspell dictionaries.
Definition: suggest.cpp:86
void StoreMainList(std::vector< std::string > &replacement)
Stores main word list. WARNING: This causes a crash due to a bug in aspell, as of aspell version 0...
Definition: suggest.cpp:532
Class for interfacing with aspell. Should work with any aspell version from 0.60 onwards.
Definition: suggest.h:31
static const char * kDEF_LANG
Default language for aspell dictionary.
Definition: suggest.h:113
Nested namespaces to allow different interfaces to different spell-checking engines.
Definition: suggest.h:23
static const char * kEMPTY
Used in place of an empty string for an aspell setting (currently, only jargon might be empty)...
Definition: suggest.h:111
void printSessionList()
Prints session word list.
Definition: suggest.cpp:387
void setConfigOpt(const std::string &opt, const std::string &val)
Sets configuration option, 'opt' to value 'val'.
Definition: suggest.cpp:516
static const char * kDICT_DELIM
Delimiter between different components of formatted strings for aspell dictionary entries...
Definition: suggest.h:107
void resetConfig()
Resets aspell configuration, as per current set of parameters.
Definition: suggest.cpp:446
static const char * kDEF_JARGON
Default jargon for aspell dictionary.
Definition: suggest.h:115
bool printSuggestions(const std::string &word, bool always=true)
Spell-checks word, and prints suggested replacements.
Definition: suggest.cpp:402
void printMainList()
Prints main word list. WARNING: This causes a crash due to a bug in aspell, as of aspell version 0...
Definition: suggest.cpp:358
void saveLists()
Saves all word lists.
Definition: suggest.cpp:502
void StorePersonalList(std::vector< std::string > &replacement)
Stores personal word list.
Definition: suggest.cpp:547
std::string getConfigOpt(const std::string &opt)
Gets value of configuration option, 'opt'.
Definition: suggest.cpp:317