Build a corpus from documents or a directory of text files.

corpus(document, ..., update_lexicon = TRUE,
  update_inverse_index = TRUE)

# S3 method for document
corpus(document, ..., update_lexicon = TRUE,
  update_inverse_index = TRUE)

# S3 method for documents
corpus(document, ..., update_lexicon = TRUE,
  update_inverse_index = TRUE)

directory_corpus(directory, update_lexicon = TRUE,
  update_inverse_index = TRUE)

Arguments

document

First document, a list, or a vector of documents.

...

Objects inheriting of class document to build a corpus.

update_lexicon

Whether to update the lexicon, see update_lexicon.

update_inverse_index

Whether to update the inverse index, see update_inverse_index.

directory

Path to a directory of text files.

Examples

# NOT RUN {
init_textanalysis()

# build document
doc1 <- string_document("First document.")
doc2 <- string_document("Second document.")

corpus <- corpus(doc1, doc2)
# }