summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVlad Voicu <vladv@rosedu.org>2012-03-05 18:28:47 (GMT)
committerKevin Smith <git@kismith.co.uk>2012-03-09 15:04:09 (GMT)
commit3049bf68ede3e1ce152561f6e8a054cca8dcad56 (patch)
tree7fca17323ef36e652f51520af58167d054d4a755 /SwifTools
parent157f45722a42a066cf6fde8eb6919668c355dd7c (diff)
downloadswift-contrib-3049bf68ede3e1ce152561f6e8a054cca8dcad56.zip
swift-contrib-3049bf68ede3e1ce152561f6e8a054cca8dcad56.tar.bz2
Improved settings for Spell Checker
Diffstat (limited to 'SwifTools')
-rw-r--r--SwifTools/SpellCheckerFactory.cpp10
-rw-r--r--SwifTools/SpellCheckerFactory.h2
2 files changed, 4 insertions, 8 deletions
diff --git a/SwifTools/SpellCheckerFactory.cpp b/SwifTools/SpellCheckerFactory.cpp
index 9ec1151..9ac33cd 100644
--- a/SwifTools/SpellCheckerFactory.cpp
+++ b/SwifTools/SpellCheckerFactory.cpp
@@ -10,8 +10,6 @@
#ifdef HAVE_HUNSPELL
#include <hunspell/hunspell.hxx>
-#else
-#define HAVE_NO_SPELL_CHECK
#endif
namespace Swift {
@@ -19,14 +17,12 @@ namespace Swift {
SpellCheckerFactory::SpellCheckerFactory() {
}
-SpellChecker* SpellCheckerFactory::createSpellChecker() {
+SpellChecker* SpellCheckerFactory::createSpellChecker(const char* affixPath, const char* dictPath) {
#ifdef HAVE_HUNSPELL
- //TODO(vladv): Do something smart about finding available dictionaries,
- // maybe a UI button to select language from available dictionaries?
- const char* dictPath = "/usr/share/hunspell/en_US.dic";
- const char* affixPath = "/usr/share/hunspell/en_US.aff";
+ std::cout << affixPath << std::endl << dictPath << std::endl;
return new HunspellChecker(affixPath, dictPath);
#endif
+ return NULL;
}
}
diff --git a/SwifTools/SpellCheckerFactory.h b/SwifTools/SpellCheckerFactory.h
index 23f89b8..85aa8b6 100644
--- a/SwifTools/SpellCheckerFactory.h
+++ b/SwifTools/SpellCheckerFactory.h
@@ -13,6 +13,6 @@ namespace Swift {
class SpellCheckerFactory {
public:
SpellCheckerFactory();
- SpellChecker* createSpellChecker();
+ SpellChecker* createSpellChecker(const char* affixPath, const char* dictPath);
};
}