Automatically replaces misspelled words in a character vector based on their string distance from a list of words sorted by frequency in a corpus.
spell_replace(
txt,
word_list = coca_list,
ignore_names = TRUE,
threshold = 0.12,
ignore_punct = FALSE
)A character vector with corrected spellings
A character vector containing text to be spell-checked
A character vector of correctly spelled words sorted by frequency (default: coca_list)
Logical. If TRUE, ignores potential proper names (capitalized words that appear multiple times)
Numeric. Maximum string distance threshold for considering a word as a correction candidate (default: 0.12)
Logical. If TRUE, ignores punctuation when calculating string distance