summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2016-05-11 08:45:10 (GMT)
committerTobias Markmann <tm@ayena.de>2016-06-23 14:55:10 (GMT)
commite5d57519f573ef3718ec207c6f81006b4a0e0244 (patch)
treee42ff13628a63b67a2c08c5f96312bbc3033a869 /SwifTools/SpellCheckerFactory.cpp
parent7f0fe603be200c09c74cf9cc295a972f3c3dbdfd (diff)
downloadswift-e5d57519f573ef3718ec207c6f81006b4a0e0244.zip
swift-e5d57519f573ef3718ec207c6f81006b4a0e0244.tar.bz2
Improve Linux spell checking UX and enable it by default
This removes support for user dictionaries for now. The new UI shows a list human readable languages (in their native spelling) where the user can select one to use for spell checking. Updated our InstallSwiftDependencies.sh based on the package names in their repositories. Test-Information: Tested on Ubuntu 16.04 with Hunspell and tested it still builds on OS X 10.11.4. Did not test InstallSwiftDependencies.sh. Change-Id: I24fc705b1495f7c39a8da149cbd7116e41609998
Diffstat (limited to 'SwifTools/SpellCheckerFactory.cpp')
-rw-r--r--SwifTools/SpellCheckerFactory.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/SwifTools/SpellCheckerFactory.cpp b/SwifTools/SpellCheckerFactory.cpp
index e53447e..bfd3d4a 100644
--- a/SwifTools/SpellCheckerFactory.cpp
+++ b/SwifTools/SpellCheckerFactory.cpp
@@ -4,6 +4,12 @@
* See Documentation/Licenses/BSD-simplified.txt for more information.
*/
+/*
+ * Copyright (c) 2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
+ */
+
#include <boost/filesystem/operations.hpp>
#include <SwifTools/SpellChecker.h>
@@ -23,17 +29,11 @@ SpellCheckerFactory::SpellCheckerFactory() {
}
#ifdef HAVE_HUNSPELL
-SpellChecker* SpellCheckerFactory::createSpellChecker(const std::string& dictFile) {
- std::string affixFile(dictFile);
- boost::replace_all(affixFile, ".dic", ".aff");
- if ((boost::filesystem::exists(dictFile)) && (boost::filesystem::exists(affixFile))) {
- return new HunspellChecker(affixFile.c_str(), dictFile.c_str());
- }
- // If dictionaries don't exist disable the checker
- return NULL;
+SpellChecker* SpellCheckerFactory::createSpellChecker() {
+ return new HunspellChecker();
}
#elif defined(SWIFTEN_PLATFORM_MACOSX)
-SpellChecker* SpellCheckerFactory::createSpellChecker(const std::string& /*dictFile*/) {
+SpellChecker* SpellCheckerFactory::createSpellChecker() {
return new MacOSXChecker();
}
#endif