Create a dictionary from a list of documents.

corpora_dictionary(docs, file = NULL)

Arguments

docs

A list of documents as returned by prepare_documents.

file

Path to save .dict, If NULL the dictionary is not saved.

Examples

docs <- prepare_documents(corpus)
#> Preprocessing 9 documents #> 9 documents after perprocessing
(dict <- corpora_dictionary(docs))
#> Dictionary(12 unique tokens: [u'minors', u'graph', u'system', u'trees', u'eps']...)