Learn R Programming

textreuse (version 0.1.2)

tokenize: Recompute the tokens for a document or corpus

Description

Given a TextReuseTextDocument or a TextReuseCorpus, this function recomputes the tokens and hashes with the functions specified. Optionally, it can also recompute the minhash signatures.

Usage

tokenize(x, tokenizer, ..., hash_func = hash_string, minhash_func = NULL,
  keep_tokens = FALSE, keep_text = TRUE)

Arguments

Value

Examples

Run this code
dir <- system.file("extdata/legal", package = "textreuse")
corpus <- TextReuseCorpus(dir = dir, tokenizer = NULL)
corpus <- tokenize(corpus, tokenize_ngrams)
head(tokens(corpus[[1]]))

Run the code above in your browser using DataLab