A quick utility for concatenating strings together. This is handy because if you want to generate the n-grams for several different texts, you must first put them into a single string unless the text is composed of sentences that should not be joined.
concatenate(..., collapse = " ", rm.space = FALSE)
A string.
Input text(s).
A character to separate the input strings if a vector of strings is supplied; otherwise this does nothing.
logical; determines if spaces should be removed from the final string.
preprocess
library(ngram)
words = c("a", "b", "c")
wordcount(words)
str = concatenate(words)
wordcount(str)
Run the code above in your browser using DataLab