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

View File

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