R !!!ngram {{pre install.packages("ngram") library(ngram) > sample <- "I often hear that death penalty is reasonable for people whose family member or friend is killed by someone." > get.ngrams(ngram(sample)) [1] "death penalty" "is reasonable" "hear that" "friend is" "is killed" "for people" "whose family" [8] "by someone." "often hear" "people whose" "that death" "killed by" "I often" "member or" [15] "or friend" "family member" "reasonable for" "penalty is" > > get.ngrams(ngram(preprocess(sample, remove.punct=TRUE))) [1] "death penalty" "is reasonable" "hear that" "friend is" "is killed" "i often" "for people" [8] "whose family" "often hear" "people whose" "by someone" "that death" "killed by" "member or" [15] "or friend" "family member" "reasonable for" "penalty is"