Skip to contents

Loads a designated corpus available in the text2map.corpora package. For bundled corpora, uses data(). For downloaded corpora, automatically detects the file format and uses the appropriate loader function.

Usage

load_corpus(corpus, location = NULL, quiet = FALSE)

Arguments

corpus

Character string indicating the corpus name to load.

location

Optional path to the corpus file. If NULL, looks in the package's data folder.

quiet

Logical (default FALSE) to suppress progress messages.

Value

The loaded corpus object (a data frame or list).

Note

The function loads downloaded corpora in the following format priority:

  1. .qs2 - Fastest loading (recommended, ~10x faster than .rda)

  2. .fst - Fast loading, data.frame only (~3x faster than .rda)

  3. .rda - Standard R format with best compression (~1x)