hutch_map: Transform on HUTCH corpora

View source: R/utils_for_tm.R

hutch_mapR Documentation

Transform on HUTCH corpora

Description

Interface to apply (using purrr) transformation functions (also denoted as mappings) to corpora. This is a slightly modification of the link[tm]{tm_map} function.

Usage

hutch_map(corpus, FUN, ...)

Arguments

corpus

A VCorpus

FUN

a transformation function taking a text document (a character vector) as input and returning a text document (a character vector of the same length as the input vector).

...

arguments to FUN

Value

A corpus with FUN applied to each document in x.

Examples

data(liu_4h28)

corpus <- data2corpus(liu_4h28, 'id', 'Liu')
hutch_map(corpus, tolower)

UBESP-DCTV/costumer documentation built on Feb. 1, 2023, 4:52 a.m.