Learn R Programming

koRpus (version 0.13-8)

pasteText: Paste koRpus objects

Description

Paste the text in koRpus objects.

Usage

pasteText(txt, ...)

# S4 method for kRp.text pasteText( txt, replace = c(hon.kRp = "", hoff.kRp = "\n\n", p.kRp = "\n\n") )

Arguments

txt

An object of class kRp.text.

...

Additional options, currently unused.

replace

A named character vector to define replacements for koRpus' internal headline and paragraph tags.

Value

An atomic character vector.

Details

This function takes objects of class kRp.text and pastes only the actual text as is.

Examples

Run this code
# NOT RUN {
# code is only run when the english language package can be loaded
if(require("koRpus.lang.en", quietly = TRUE)){
  sample_file <- file.path(
    path.package("koRpus"), "examples", "corpus", "Reality_Winner.txt"
  )
  tokenized.obj <- tokenize(
    txt=sample_file,
    lang="en"
  )
  tokenized.obj <- jumbleWords(tokenized.obj)
  pasteText(tokenized.obj)
} else {}
# }

Run the code above in your browser using DataLab