Function to create ngram docs

Share:

Description

Function to create ngram docs

Usage

1
ngram(x, k = 1)

Arguments

x

tmCorpus object

k

number of words in ngram

Value

returns tmParsed object of ngrams

Examples

1
2
3
4
corp <- tmCorpus(c("This is first document", "This is second"))
parsed_ngrams <- ngram(corp, k = 2)
tabled <- make_tabled(parsed_ngrams)
content(tabled)