search_openresult_inelan {act}R Documentation

Open a search result in 'ELAN'

Description

The function creates an temporary .eaf file and a .psfx file that locates the search hit. These files will then be opened in ELAN. To make this function work you need to have 'ELAN' installed on your computer and tell the act package where ELAN is located. Therefore you need to set the path to the ELAN executable in the option 'act.path.elan' using options(act.path.elan='PATHTOYOURELANEXECUTABLE').

Usage

search_openresult_inelan(
  x,
  s,
  resultNr,
  openOriginalEafFileIfAvailable = FALSE
)

Arguments

x

Corpus object.

s

Search object.

resultNr

Integer; Number of the search result (row in the data frame s@results) to be opened.

openOriginalEafFileIfAvailable

Logical; if TRUE the function will check if the original annotation file was an .eaf file and if it still exists in the original location. If so, the function will not create a temporary .eaf file but open the original file. Warning: The original .pfsx file (if it exists) will be overwritten.

Details

WARNING: This function will overwrite existing .psfx files.

Credits: Thanks to Han Sloetjes for feedback on the structure of the temporary .pfsx files. He actually made the code work.

Examples

library(act)

mysearch <- act::search_new(x=examplecorpus, pattern = "yo")

# You can only use this function if you have installed ELAN on our computer.
## Not run: 
options(act.path.elan='PATHTOYOURELANEXECUTABLE')
act::search_openresult_inelan(x=examplecorpus, s=mysearch, resultNr=1, TRUE)

## End(Not run)


[Package act version 1.1.9 Index]