spellReplace: Replace all misspelled words with either the suggested...

Description Usage Arguments Value Note

View source: R/spell-punct.R

Description

Replace all misspelled words with either the suggested replacement or the specified replacement

Usage

1
2
spellReplace(txt, keepWords = NULL, replaceWords = NULL,
  spellcheck = TRUE)

Arguments

txt

a character or character vector to be spell checked

keepWords

a character vector of words to not replace with the inferred best word

replaceWords

a character vector of the same length as keepWords of the user-defined replacements for the given words

spellcheck

logical, defaults to TRUE. If TRUE, does an automatic spell check with hunspell. If FALSE, makes only the user entered replacements.

Value

A list with two fields: text, a character or character vector with only single spaces, and replacements, a dataframe documenting each word replaced and what it was replaced by.

Note

This will sometimes remove some/all punctuation and other times may add punctuation.


mattgarber4/gsgWordcloud documentation built on Nov. 4, 2019, 6:17 p.m.