search_makefilter {act} | R Documentation |
Makes a filter for transcript and tier names
Description
Search a corpus object and return the names of all transcripts and tiers that match the given parameters. You can define parameters to include and/or exclude transcripts and tiers based on their names. All parameters passed to the function will be combined.
Usage
search_makefilter(
x,
filterTranscriptNames = NULL,
filterTranscriptIncludeRegEx = NULL,
filterTranscriptExcludeRegEx = NULL,
filterTierNames = NULL,
filterTierIncludeRegEx = NULL,
filterTierExcludeRegEx = NULL
)
Arguments
x |
Corpus object. |
filterTranscriptNames |
Vector of character strings; Names of the transcripts that you want to include; to include all transcripts in the corpus object leave parameter empty or set to |
filterTranscriptIncludeRegEx |
Character string; as regular expression, include transcripts matching the expression. |
filterTranscriptExcludeRegEx |
Character string; as regular expression, exclude transcripts matching the expression. |
filterTierNames |
Vector of character strings; Names of the tiers that you want to include; to include all tiers in the corpus object leave parameter empty or set to |
filterTierIncludeRegEx |
Character string; as regular expression, include tiers matching the expression. |
filterTierExcludeRegEx |
Character string; as regular expression, exclude tiers matching the expression. |
Details
This functions is useful if you want to use functions of the package such as transcripts_update_normalization
, transcripts_update_fulltexts
, corpus_export
and limit them to only some of the transcripts.
Value
List of character vectors. $filterTranscriptNames
contains all transcript names in the corpus matching the expressions, $filterTierNames
contains all tier names in the corpus matching the expressions.
See Also
search_new, search_run, search_sub
Examples
library(act)
# Search all transcripts that have "ARG" (ignoring case sensitivity) in their name
myfilter <- act::search_makefilter(x=examplecorpus, filterTranscriptIncludeRegEx="(?i)arg")
myfilter$transcript.names
# Search all transcripts that don't have "ARG" in their name
myfilter <- act::search_makefilter(x=examplecorpus, filterTranscriptExcludeRegEx="ARG")
myfilter$transcript.names
# Search all tiers that have an "A" or an "a" in their name
myfilter <- act::search_makefilter(x=examplecorpus, filterTierIncludeRegEx="(?i)A")
myfilter$tier.names
# Search all tiers that have a capital "A" in their name
myfilter <- act::search_makefilter(x=examplecorpus, filterTierIncludeRegEx="A")
myfilter$tier.names
# In which transcripts do these tiers occur?
myfilter$transcript.names
# Let's check the first of the transcripts, if this is really the case...
examplecorpus@transcripts[[myfilter$transcript.names[1]]]@tiers