import_textgrid {act}R Documentation

Import a single 'Praat' .TextGrid file


Advice: In most situations it is more convenient to use act::corpus_new, act::corpus_import for importing annotation files.


import_textgrid(filePath = NULL, fileContent = NULL, transcriptName = NULL)



Character string; input path of a single 'Praat' .TextGrid file.


Vector of character strings; contents of a 'Praat' .TextGrid file read with readLines().


Character string; name of the transcript.


Imports the contents of a 'Praat' .TextGrid file and returns a transcript object. The source is either the path to a .TextGrid file or the contents of a .TextGrid file obtained from the @file.content of an existing transcript object by readLines(). If you pass 'fileContent' you need to pass 'transcriptName' as parameter, too.

Please note: - Time values of annotations in TextGrids may be below 0 seconds. Negative time values will be recognized corretly in the first place. When exporting transcript object to other formats like 'ELAN' .eaf, 'EXMARaLDA' .exb ect. annotations that are completely before 0 sec will be deleted, annotations that start before but end after 0 sec will be truncated. Please see also the function act::transcripts_cure_single. - TextGrids and contained tiers may start and end at different times. These times do not need to match each other. The act package does not support start and end times of TextGrids and tiers and will. The default start of a TextGrid will be 0 seconds or the lowest value in case that annotations start below 0 seconds.


Transcript object.

See Also

corpus_import, corpus_new, import, import_eaf, import_exb, import_rpraat



# Path to the .TextGrid file that you want to read
path <- system.file("extdata", "examplecorpus", "GAT", 
					"ARG_I_PAR_Beto.TextGrid", package="act")

# To import a .TextGrid file of your choice:
## Not run: 

## End(Not run)

t <- act::import_textgrid(filePath=path)

# Content of a .TextGrid (already read by \code{readLines}), 
# e.g. from an existing transcript object:
mycontent <- examplecorpus@transcripts[[1]]@file.content
t <- act::import_textgrid(fileContent=mycontent, transcriptName="test")

[Package act version 1.1.9 Index]