Finds the best correction for a single misspelled word using string distance and frequency-based ranking from a sorted word list.
correct(word, sorted_words, ignore_punct = FALSE, threshold = 0.12)A character string with the corrected word
A character string representing the misspelled word
A character vector of correctly spelled words sorted by frequency
Logical. If TRUE, ignores punctuation when calculating string distance
Numeric. Maximum string distance threshold for considering a word as a correction candidate