Description Usage Arguments Value Examples
This method either takes a character vector or objects inheriting class kRp.text
(i.e., text tokenized by koRpus
),
and jumbles the words. This usually means that the
first and last letter of each word is left intact,
while all characters inbetween are being
randomized.
1 2 3 4 5 6 7 | jumbleWords(words, ...)
## S4 method for signature 'kRp.text'
jumbleWords(words, min.length = 3, intact = c(start = 1, end = 1))
## S4 method for signature 'character'
jumbleWords(words, min.length = 3, intact = c(start = 1, end = 1))
|
words |
Either a character vector or an object inheriting from class |
... |
Additional options, currently unused. |
min.length |
An integer value, defining the minimum word length. Words with less characters will not be changed. Grapheme clusters are counted as one. |
intact |
A named vector with the two integer values named |
Depending on the class of words
, either a character vector or an object of class
kRp.text
with the added feature diff
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | # 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)
# diff stats are now part of the object
hasFeature(tokenized.obj)
diffText(tokenized.obj)
} else {}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.