Helper function for kwic designed to parse sequence matches into contexts and keywords.

kwic_split(char, mask, window)

Arguments

char
character vector
mask
numeric vector with the same length as char where 1 indicate appearance of keywords
window
size of the pre and post contexts

Examples

## Not run: ------------------------------------ # kwic_split(letters[1:5], c(0, 1, 1, 0, 1), window = 1) # kwic_split(letters[1:5], c(1, 1, 1, 0, 1), window = 1) ## ---------------------------------------------