Extracts ngram bag of words around words that match a search pattern.
Note: If an input contains the search pattern twice, only the ngram bag of words of the last hit is detected. Consider individual text splitting with text2sentences() or strsplit2() before applying ngram().
text<-"One hundred twenty-eight students participated in our Study,
that was administred in thirteen clinics."ngram(text,pattern="study",ngram=c(-1,2))