View source: R/corpus_import.R
corpus_import | R Documentation |
Scans all path specified in if x@paths.annotation.files
for annotation files.
Supported file formats will be loaded as transcript objects into the corpus object.
All previously loaded transcript objects will be deleted.
corpus_import(x, createFullText = TRUE, assignMedia = TRUE)
x |
Corpus object. |
createFullText |
Logical; if |
assignMedia |
Logical; if |
If assignMedia=TRUE
the paths defined in x@paths.media.files
will be scanned for media files.
Based on their file names the media files and annotations files will be matched.
Only the the file types set in options()$act.fileformats.audio
and options()$act.fileformats.video
will be recognized.
You can modify these options to recognize other media types.
See @import.results
of the corpus object to check the results of importing the files.
To get a detailed overview of the corpus object use act::info(x)
, for a summary use act::info_summarized(x)
.
Corpus object.
corpus_new, examplecorpus
library(act) # The example files that come with the act library are located here: path <- system.file("extdata", "examplecorpus", package="act") # This is the examplecorpus object that comes with the library examplecorpus # Make sure that the input folder of the example corpus object is set correctly examplecorpus@paths.annotation.files <- path examplecorpus@paths.media.files <- path # Load annotation files into the corpus object (again) examplecorpus <- act::corpus_import(x=examplecorpus) # Creating the full texts may take a long time. # If you do NOT want to create the full texts immediately use the following command: examplecorpus <- act::corpus_import(x=examplecorpus, createFullText=FALSE )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.