Commit 0bf0fd9f authored by Manuel Cortez's avatar Manuel Cortez

Fixed small issue with dicts

parent 17bfa4b2
Pipeline #624 failed with stages
in 40 seconds
......@@ -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):
......
......@@ -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()
......
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment