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

Description Usage Arguments Value Examples

Description

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

Usage

1
2
3
## S4 method for signature '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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# 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 {}

unDocUMeantIt/tm.plugin.koRpus documentation built on May 21, 2021, 9:27 p.m.