'Replaces the selected text with word.'

def correct(self, word):

    cursor = self.textCursor()
    cursor.beginEditBlock()
    cursor.removeSelectedText()
    cursor.insertText(word)
    cursor.endEditBlock()
