Description Usage Arguments Value See Also Examples
Find label or consecutive sequence of labels and returns their indices.
1 | tg.findLabels(tg, tierInd, labelVector, returnTime = FALSE)
|
tg |
TextGrid object |
tierInd |
tier index or "name" |
labelVector |
character string (one label) or vector of character strings (consecutive sequence of labels) to be found |
returnTime |
If |
If returnTime == FALSE
, returns list of all occurrences, each member of the list is one occurence and contains vector of label indices, if returnTime == TRUE
, returns list witch vectors t1 (begin) and t2 (end) for each found group of sequence of labels.
tg.countLabels
, tg.getLabel
, tg.duplicateTierMergeSegments
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | tg <- tg.sample()
i <- tg.findLabels(tg, "phoneme", "n")
i
length(i)
i[[1]]
i[[2]]
tg$phoneme$label[unlist(i)]
i <- tg.findLabels(tg, "phone", c("?", "a"))
i
length(i)
tg$phone$label[i[[1]]]
tg$phone$label[i[[2]]]
tg$phone$label[unlist(i)]
t <- tg.findLabels(tg, "phone", c("?", "a"), returnTime = TRUE)
t
t$t2[1] - t$t1[1] # duration of the first result
t$t2[2] - t$t1[2] # duration of the second result
i <- tg.findLabels(tg.sample(), "word", c("ti", "reknu", "co"))
i
length(i)
length(i[[1]])
i[[1]]
i[[1]][3]
tg$word$label[i[[1]]]
t <- tg.findLabels(tg.sample(), "word", c("ti", "reknu", "co"), returnTime = TRUE)
pt <- pt.sample()
tStart <- t$t1[1]
tEnd <- t$t2[1]
## Not run:
pt.plot(pt.cut(pt, tStart, tEnd))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.