handle_negation(c("i", "am", "not", "happy"))
# Returns: c("i", "am", "not_happy")
handle_negation(c("this", "is", "not", "good", "but", "not", "terrible"))
# Returns: c("this", "is", "not_good", "but", "not_terrible")
handle_negation(c("nothing", "to", "worry", "about"))
# Returns: c("nothing", "to", "worry", "about")
Run the code above in your browser using DataLab