Access n-grams tokens of documents as a vector.

get_ngrams(document, ...)

# S3 method for document
get_ngrams(document, ...)

# S3 method for documents
get_ngrams(document, ...)

# S3 method for corpus
get_ngrams(document, ...)

Arguments

document

A document as returned by the *_document family of functions, i.e.: string_document.

...

Any other positional arguments.

Value

A tibble of ngrams and their occurences.

Examples

# NOT RUN {
init_textanalysis()

# build document
doc <- string_document("This is a document.")

# extract n-grams
get_ngrams(doc)
get_ngrams(doc, 2L)
# }