What algorithm is used for finding ngrams?
Supposing my input data is an array of words and the size of the ngrams I want to find, what algorithm I should use?
Have a look at https://cran.r-project.org/web/packages/ngram/vignettes/ngram-guide.pdf
Here is a quick example. It's quite fast look at the benchmark of the vignette.
require(ngram) "hi i am ig" %>% ngram(n = 2) %>% get.ngrams()