From 0bf0fd9f2781d35e4765b5d992b90985348ad6ed Mon Sep 17 00:00:00 2001 From: Manuel Cortez Date: Tue, 3 Dec 2019 12:06:36 -0600 Subject: [PATCH] Fixed small issue with dicts --- src/extra/SpellChecker/checker.py | 4 ---- src/extra/SpellChecker/spellchecker.py | 2 +- src/main.py | 2 +- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/extra/SpellChecker/checker.py b/src/extra/SpellChecker/checker.py index 9d9960f..4e8b831 100644 --- a/src/extra/SpellChecker/checker.py +++ b/src/extra/SpellChecker/checker.py @@ -74,8 +74,6 @@ class SpellChecker(object): if len(suggestions) == 0: continue for s in suggestions: - print(s.term) - print(s.distance) if s.distance == 0: valid_word = False if valid_word == False: @@ -90,8 +88,6 @@ class SpellChecker(object): else: context = " ".join(self.transformed_words[word-5:word+5]) self.word_index = word -# print(self.word) -# print(suggestions[0].distance) yield (suggestions, context, word) def replace(self, suggestion): diff --git a/src/extra/SpellChecker/spellchecker.py b/src/extra/SpellChecker/spellchecker.py index 6df29d8..8080e43 100644 --- a/src/extra/SpellChecker/spellchecker.py +++ b/src/extra/SpellChecker/spellchecker.py @@ -19,7 +19,7 @@ class spellChecker(object): self.checker = checker.SpellChecker() log.debug("Using language: %s" % (languageHandler.getLanguage(),)) try: - self.checker.set_language(languageHandler.curLang) + self.checker.set_language(languageHandler.curLang::2]) except ValueError: log.exception("Dictionary for language %s not found." % (languageHandler.curLang,)) wx_ui.dict_not_found_error() diff --git a/src/main.py b/src/main.py index 6f97315..8847021 100644 --- a/src/main.py +++ b/src/main.py @@ -61,7 +61,7 @@ def setup(): del sm log.debug("Loading dictionaries for spelling correction...") # Let's copy dictionary files for the selected language just in case it is not present already. - checker.prepare_dicts(languageHandler.curLang) + checker.prepare_dicts(languageHandler.curLang[:2]) call_threaded(checker.load_dicts) r = mainController.Controller() call_threaded(r.login)