tg.boundaryMagnet {rPraat} | R Documentation |
tg.boundaryMagnet
Description
Aligns boundaries of intervals in the target tier (typically: "word") to the closest boundaries in the pattern tier (typically: "phone"). If there is no boundary within the tolerance limit in the pattern tier, the boundary position in the target tier is kept at its original position.
Usage
tg.boundaryMagnet(
tg,
targetTier,
patternTier,
boundaryTolerance = Inf,
verbose = TRUE
)
Arguments
tg |
TextGrid object |
targetTier |
index or "name" of the tier to be aligned |
patternTier |
index or "name" of the pattern tier |
boundaryTolerance |
if there is not any boundary in the pattern tier within this tolerance, the target boundary is kept at its position [default: |
verbose |
if TRUE, every boundary shift is printed [default: |
Value
TextGrid object
See Also
tg.insertBoundary
, tg.insertInterval
, tg.duplicateTier
Examples
## Not run:
tg <- tg.sample()
tg <- tg.removeTier(tg, "phoneme")
tg <- tg.removeTier(tg, "syllable")
tg <- tg.removeTier(tg, "phrase")
# garble times in "word" tier a little
n <- length(tg$word$label)
deltaT <- runif(n - 1, min = -0.01, max = 0.015)
tg$word$t2[1: (n-1)] <- tg$word$t2[1: (n-1)] + deltaT
tg$word$t1[2: n] <- tg$word$t2[1: (n-1)]
tg.plot(tg)
# align "word" tier according to "phone tier"
tg2 <- tg.boundaryMagnet(tg, targetTier = "word", patternTier = "phone")
tg.plot(tg2)
## End(Not run)
[Package rPraat version 1.3.2-1 Index]