Fixed small issue with dicts
This commit is contained in:
parent
17bfa4b260
commit
0bf0fd9f27
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user