mapPrefix: Replace corpus prefix

Description Usage Arguments Value Examples

View source: R/collections.R

Description

This function can be used to replace corpus prefixes. If a list of play ids contains textgrid prefixes, for instance, this function can be used to map them onto GerDraCor prefixes. Please note that the function does not check whether the play actually exists in the corpus.

Usage

1
mapPrefix(idList, map)

Arguments

idList

The list of ids in which we want to replace.

map

A list containing the old prefix as name and the new one as values.

Value

The function returns a list of the same length of the input list, but with replaced play prefixes.

Examples

1
2
# returns c("corpus2:play1", "corpus2:play2")
mapPrefix(c("corpus1:play1", "corpus1:play2"), list(corpus1="corpus2"))

DramaAnalysis documentation built on Jan. 13, 2021, 10:02 p.m.