make.seglist: Make an Emu segment list from the various components

View source: R/emusegs.R

make.seglistR Documentation

Make an Emu segment list from the various components

Description

This is the appropriate way to make an Emu segment list and ensure that it has all of the required components.

Usage

make.seglist(labels, start, end, utts, query, type, database)

Arguments

labels

A character vector of labels for each segment

start

A vector of start times

end

A vector of end times

utts

A character vector of utterance names

query

A query string

type

segment or event

database

The database name associated with the segment list

Details

An Emu segment list is the result of a query to a speech database (see query) and has one row per matching segment or event from the query. Each row lists the label, start and end times (in milliseconds) and utterance name for the segment. This information is used by get_trackdata and other functions to extract data corresponding to these segments.

In order to ensure the proper format for segment lists and to ensure against future changes to the format, make.seglist should be used whenever you wish to create a segment list. Another function, modify.seglist can be used to change some part of an existing segment list. The functions label.emusegs, start.emusegs, end.emusegs and utt.emusegs can be used to access the different columns of the segment list.

Value

An Emu segment list.

Author(s)

Steve Cassidy

See Also

modify.seglist, label.emusegs

Examples



   l <- c("A", "B", "C")
   s <- 1:3
   e <- 2:4
   u <- c("u1", "u1", "u1")
   segs <- make.seglist(l, s, e, u, "Fake Query", "segment", "fake")
   segs
   ## summary gives an overview of the data in the segment list
   summary(segs)
   

   # The following should be TRUE
   label(segs) == l
   dur(segs) == s
   end(segs) == e
   utt(segs) == u
   emusegs.database(segs) == "fake"
   emusegs.type(segs) == "segment"
   emusegs.query(segs) == "Fake Query"

   # segment durations should all be 1
   dur(segs) == c(1,1,1)



emuR documentation built on Nov. 4, 2023, 1:06 a.m.