R/edit_contractions.R

Defines functions edit_contractions

Documented in edit_contractions

load("data/contractions.rda")

edit_contractions <- function(text){

    x <- contractions$contraction
    y <- contractions$expansion

    x <- paste0('(?<!\\w)', x, '(?!\\w)')

    text <- mgsub_regex(text, x, y, perl = T)


    return(text)


}
achilleas-251/txtprocess documentation built on March 30, 2020, 12:43 a.m.