Description Usage Arguments Value See Also Examples
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.
1 2 3 4 5 6 7 | tg.boundaryMagnet(
tg,
targetTier,
patternTier,
boundaryTolerance = Inf,
verbose = TRUE
)
|
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: |
TextGrid object
tg.insertBoundary
, tg.insertInterval
, tg.duplicateTier
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | ## 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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.