Planeshift
spellchecker.h
Go to the documentation of this file.
1 /*
2 * spellchecker.h, Author: Fabian Stock (AiwendilH@googlemail.com)
3 *
4 * Copyright (C) 2001-2011 Atomic Blue (info@planeshift.it, http://www.atomicblue.org)
5 *
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation (version 2 of the License)
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 *
18 */
19 
20 #ifndef _SPELLCHECKER_H_
21 #define _SPELLCHECKER_H_
22 
23 // crystalSpace includes
24 #include <iutil/comp.h>
25 
26 // Hunspell includes
27 #include <hunspell.hxx>
28 
29 //my own includes
30 #include <ispellchecker.h>
31 
32 struct iObjectRegistry;
33 
37 class SpellChecker : public scfImplementation2<SpellChecker, iSpellChecker, iComponent>
38 {
39  public:
40  SpellChecker(iBase* parent);
41  virtual ~SpellChecker();
42 
43  //from iComponent
44  virtual bool Initialize(iObjectRegistry* objReg);
45 
46  //from iSpellChecker
47  virtual void addWord(csString newWord);
48  virtual const csArray<csString>& getPersonalDict() {return personalDict;};
49  virtual void clearPersonalDict();
50  virtual bool hasDicts() {return hunspellChecker.GetSize() != 0;};
51  virtual bool correct(csString wordToCheck);
52  protected:
55  virtual void removeSpecialChars(csString& str);
56  private:
59  csArray<Hunspell*> hunspellChecker;
62  csArray<csString> personalDict;
63 
64 };
65 
66 
67 #endif // _SPELLCHECKER_H_
virtual bool hasDicts()
Definition: spellchecker.h:50
virtual void clearPersonalDict()
virtual bool correct(csString wordToCheck)
virtual void addWord(csString newWord)
CS Plugin for a hunspell spellchecker.
Definition: spellchecker.h:37
virtual void removeSpecialChars(csString &str)
Helper method that removes chars from a string which confuse the spellchecker.
virtual ~SpellChecker()
virtual const csArray< csString > & getPersonalDict()
Definition: spellchecker.h:48
virtual bool Initialize(iObjectRegistry *objReg)
SpellChecker(iBase *parent)