summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVlad Voicu <vladv@rosedu.org>2012-03-05 18:28:47 (GMT)
committervlad <vlad@tyrion.(none)>2012-10-13 13:55:45 (GMT)
commit5ca749621b991e6a1e10d7a809d0fe1f0680ca74 (patch)
tree0b9683d47ce43376a48103d7e7381f207681cd2c /SwifTools
parenta74153f0af0149b445eb5fd18f616e8a3e7f8462 (diff)
downloadswift-contrib-5ca749621b991e6a1e10d7a809d0fe1f0680ca74.zip
swift-contrib-5ca749621b991e6a1e10d7a809d0fe1f0680ca74.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);
};
}