def check_spelling(text):
    chkr.set_text(text)
    for err in chkr:
        suggestions = err.suggest()
        if suggestions:
            suggest = suggestions[0]
            err.replace(suggest)
    text = chkr.get_text()
    return text
Esempio n. 2
0
def check_spelling(text):
    chkr.set_text(text)
    mistakes = []
    for err in chkr:
        suggestions = err.suggest()
        if suggestions:
            suggest = suggestions[0]
            err.replace(suggest)
            word = err.word
            mistakes.append((word, suggest))
    text = chkr.get_text()
    return text, mistakes