Would like to know the error while using str_replace_all
while doing a transformation on a string:
abc <- "Good Product ...but it's darken the skin tone..why...?"
I would like to do an additional manipulation in order to enable convert it to something like below, before running sentence tokenization using quanteda:
abc_new <- "Good Product. But it's darken the skin tone. Why?"
I am using the following regex to enable this:
str_replace_all(abc,"\\.{2,15}[a-z]{1}", paste(".", toupper(str_extract_all(str_extract_all(abc,"\\.{2,15}[a-z]{1}"),"[a-z]{1}")[[1]])[[1]], collapse = " "))
However this throws: "Good Product. Cut it's darken the skin tone. Chy...?"
Can someone suggest a solution for this?