Learn R Programming

tm.plugin.koRpus (version 0.4-2)

hyphen,kRp.corpus-method: Apply hyphen() to all texts in kRp.corpus objects

Description

This method calls hyphen on all tagged text objects inside the given words object (using mclapply).

Usage

# S4 method for kRp.corpus
hyphen(words, mc.cores = getOption("mc.cores", 1L), quiet = TRUE,
      ...)

Arguments

words

An object of class kRp.corpus.

mc.cores

The number of cores to use for parallelization, see mclapply.

quiet

Logical, if FALSE shows a status bar for the hyphenation process of each text.

...

options to pass through to hyphen.

Value

An object of the same class as words.

Examples

Run this code
# NOT RUN {
# use readCorpus() to create an object of class kRp.corpus
# code is only run when the english language package can be loaded
if(require("koRpus.lang.en", quietly = TRUE)){
  myCorpus <- readCorpus(
    dir=file.path(
      path.package("tm.plugin.koRpus"), "examples", "corpus", "Winner", "Wikipedia_new"
    ),
    # use tokenize() so examples run without a TreeTagger installation
    tagger="tokenize",
    lang="en"
  )

  myCorpus <- hyphen(myCorpus)
} else {}
# }

Run the code above in your browser using DataLab