replace_misspelling: Replace Misspelled Words

Description Usage Arguments Value Note Author(s) Examples

View source: R/replace_misspelling.R

Description

Replace misspelled words with their most likely replacement. This function uses hunspell in the backend. hunspell must be installed in order to use this feature.

Usage

1

Arguments

x

A character vector.

...

ignored..

Value

Returns a vector of strings with misspellings replaced.

Note

The function splits the string apart into tokens for speed optimization. After the replacement occurs the strings are pasted back together. The strings are not guaranteed to retain exact spacing of the original.

Author(s)

Surin Space and Tyler Rinker <tyler.rinker@gmail.com>.

Examples

1
2
3
4
5
6
## Not run: 
bad_string <- c("I cant spelll rigtt noow.", '', NA, 
    'Thiss is aslo mispelled?', 'this is 6$ and 38 cents in back2back!')
replace_misspelling(bad_string)

## End(Not run)

trinker/textclean documentation built on Nov. 3, 2021, 7:20 p.m.