Document Hunspell.

Originally committed to SVN as r3352.
This commit is contained in:
Amar Takhar 2009-08-01 04:37:29 +00:00
parent 6bde901e5e
commit 5ccf95b9df
2 changed files with 27 additions and 37 deletions

View File

@ -58,7 +58,6 @@
/// @brief Constructor /// @brief Constructor
///
HunspellSpellChecker::HunspellSpellChecker() { HunspellSpellChecker::HunspellSpellChecker() {
hunspell = NULL; hunspell = NULL;
conv = NULL; conv = NULL;
@ -68,15 +67,13 @@ HunspellSpellChecker::HunspellSpellChecker() {
/// @brief Destructor /// @brief Destructor
///
HunspellSpellChecker::~HunspellSpellChecker() { HunspellSpellChecker::~HunspellSpellChecker() {
Reset(); Reset();
} }
/// @brief Reset /// @brief Reset spelling library
///
void HunspellSpellChecker::Reset() { void HunspellSpellChecker::Reset() {
delete hunspell; delete hunspell;
hunspell = NULL; hunspell = NULL;
@ -89,8 +86,8 @@ void HunspellSpellChecker::Reset() {
/// @brief Can add to dictionary? /// @brief Can add to dictionary?
/// @param word /// @param word Word to check.
/// @return /// @return Whether word can be added or not.
/// ///
bool HunspellSpellChecker::CanAddWord(wxString word) { bool HunspellSpellChecker::CanAddWord(wxString word) {
if (!hunspell) return false; if (!hunspell) return false;
@ -101,8 +98,7 @@ bool HunspellSpellChecker::CanAddWord(wxString word) {
/// @brief Add word to dictionary /// @brief Add word to dictionary
/// @param word /// @param word Word to add.
/// @return
/// ///
void HunspellSpellChecker::AddWord(wxString word) { void HunspellSpellChecker::AddWord(wxString word) {
// Dictionary OK? // Dictionary OK?
@ -168,9 +164,9 @@ void HunspellSpellChecker::AddWord(wxString word) {
/// @brief Check if the word is valid /// @brief Check if the word is valid.
/// @param word /// @param word Word to check
/// @return /// @return Whether word is valid or not.
/// ///
bool HunspellSpellChecker::CheckWord(wxString word) { bool HunspellSpellChecker::CheckWord(wxString word) {
if (!hunspell) return true; if (!hunspell) return true;
@ -181,9 +177,9 @@ bool HunspellSpellChecker::CheckWord(wxString word) {
/// @brief Get suggestions for word /// @brief Get suggestions for word.
/// @param word /// @param word Word to get suggestions for
/// @return /// @return List of suggestions
/// ///
wxArrayString HunspellSpellChecker::GetSuggestions(wxString word) { wxArrayString HunspellSpellChecker::GetSuggestions(wxString word) {
// Array // Array
@ -216,8 +212,8 @@ wxArrayString HunspellSpellChecker::GetSuggestions(wxString word) {
/// @brief Get list of available dictionaries /// @brief Get list of available dictionaries.
/// @return /// @return List of available dictionaries
/// ///
wxArrayString HunspellSpellChecker::GetLanguageList() { wxArrayString HunspellSpellChecker::GetLanguageList() {
// Get dir name // Get dir name
@ -251,8 +247,8 @@ wxArrayString HunspellSpellChecker::GetLanguageList() {
/// @brief Set language /// @brief Set language.
/// @param language /// @param language Language to set
/// ///
void HunspellSpellChecker::SetLanguage(wxString language) { void HunspellSpellChecker::SetLanguage(wxString language) {
// Unload // Unload
@ -301,5 +297,3 @@ void HunspellSpellChecker::SetLanguage(wxString language) {
} }
#endif // WITH_HUNSPELL #endif // WITH_HUNSPELL

View File

@ -47,27 +47,25 @@
/// DOCME
/// @class HunspellSpellChecker /// @class HunspellSpellChecker
/// @brief DOCME /// @brief Hunspell spell checker
/// ///
/// DOCME
class HunspellSpellChecker : public SpellChecker { class HunspellSpellChecker : public SpellChecker {
private: private:
/// DOCME /// Hunspell instance
Hunspell *hunspell; Hunspell *hunspell;
/// DOCME /// Conversion buffer
wxMBConv *conv; wxMBConv *conv;
/// DOCME /// Path to .aff file
wxString affpath; wxString affpath;
/// DOCME /// Path to .dic file
wxString dicpath; wxString dicpath;
/// DOCME /// Path to user-local dictionary.
wxString usrdicpath; wxString usrdicpath;
void Reset(); void Reset();
@ -88,15 +86,13 @@ public:
/// DOCME
/// @class HunspellSpellCheckerFactory /// @class HunspellSpellCheckerFactory
/// @brief DOCME /// @brief Hunspell SpellChecker Factory
/// ///
/// DOCME
class HunspellSpellCheckerFactory : public SpellCheckerFactory { class HunspellSpellCheckerFactory : public SpellCheckerFactory {
public: public:
/// @brief DOCME /// @brief Create new Hunspell Spell checker.
/// ///
SpellChecker *CreateSpellChecker() { return new HunspellSpellChecker(); } SpellChecker *CreateSpellChecker() { return new HunspellSpellChecker(); }
}; };