clozeDelete-methods: Transform text into cloze test format

Description Usage Arguments Details Value


If you feed a tagged text object to this function, its text will be transformed into a format used for cloze deletion tests. That is, by default every fifth word (or as specified by every) will be replaced by a line. You can also set an offset value to specify where to begin.


clozeDelete(obj, ...)

## S4 method for signature 'kRp.taggedText'
clozeDelete(obj, every = 5, offset = 0, = "_", fixed = 10)



An object of class "kRp.tagged"


Additional arguments to the method (as described in this document).


Integer numeric, setting the frequency of words to be manipulated. By default, every fifth word is being transformed.


Either an integer numeric, sets the number of words to offset the transformations. Or the special keyword "all", which will cause the method to iterate through all possible offset values and not return an object, but print the results (including the list with changed words).

Character, will be used as the replacement for the removed words.


Integer numberic, defines the length of the replacement ( will be repeated this much times). If set to 0, the replacement wil be as long as the replaced word.


The option offset="all" will not return one single object, but print the results after iterating through all possible offset values.


An object of class kRp.tagged, with an additional list cloze in its desc slot, listing the words which were changed.

koRpus documentation built on May 19, 2017, 11:07 p.m.

Search within the koRpus package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at

Please suggest features or report bugs in the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.