text_split(c("I saw Mr. Jones today.",
"Split across\na line.",
"What. Are. You. Doing????",
"She asked 'do you really mean that?' and I said 'yes.'"),
units = "sentences")
# disable the default sentence suppressions
text_split("I saw Mr. Jones today.", units = "sentences", suppress = NULL)
# break on CR and LF
text_split("Split across\na line.", units = "sentences", crlf_break = TRUE)
# 2-sentence blocks
text_split(c("What. Are. You. Doing????",
"She asked 'do you really mean that?' and I said 'yes.'"),
units = "sentences", size = 2)
# 4-token blocks
text_split(c("What. Are. You. Doing????",
"She asked 'do you really mean that?' and I said 'yes.'"),
units = "tokens", size = 4)
Run the code above in your browser using DataLab