diff options
Diffstat (limited to 'SwifTools/SpellChecker.h')
-rw-r--r-- | SwifTools/SpellChecker.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/SwifTools/SpellChecker.h b/SwifTools/SpellChecker.h index a7272e9..a9cbe77 100644 --- a/SwifTools/SpellChecker.h +++ b/SwifTools/SpellChecker.h @@ -4,7 +4,10 @@ * See Documentation/Licenses/BSD-simplified.txt for more information. */ +#include <SwifTools/SpellParser.h> + #include <boost/algorithm/string.hpp> +#include <boost/tuple/tuple.hpp> #include <vector> #pragma once @@ -12,8 +15,16 @@ namespace Swift { class SpellChecker { public: - virtual ~SpellChecker() { }; + SpellChecker() { + parser_ = new SpellParser(); + } + virtual ~SpellChecker() { + delete parser_; + }; virtual bool isCorrect(const std::string& word) = 0; virtual void getSuggestions(const std::string& word, std::vector<std::string>& list) = 0; + virtual void checkFragment(const std::string& fragment, PositionPairVector& misspelledPositions) = 0; + protected: + SpellParser *parser_; }; } |