Learn R Programming

koRpus (version 0.04-40)

cTest: Transform text into C-Test-like format

Description

If you feed a tagged text object to this function, its text will be transformed into a format used for C-Tests:
  • the first and last sentence will be left untouched (except if thestartandstopvalues of theintactparameter are changed
of all other sentences, the second half of every 2nd word (or as specified by every) will be replaced by a line words must have at least min.length characters, otherwise they are skipped words an uneven number of characters will be replaced after the next character, i.e., a word with five characters will keep the first three and have the last two replaced

Arguments

obj
An object of class "kRp.tagged"
every
Integer numeric, setting the frequency of words to be manipulated. By default, every other word is being transformed.
min.length
Integer numeric, sets the minimum length of words to be considered (in letters).
intact
Named vector with the elements start and end. both must be integer values and define, which sentences are to be left untouched, counted in sentences from beginning and end of the text. The default is to ignore the first
replace.by
Character, will be used as the replacement for the removed word halves.

Value

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