expressionFromAttributeValuesCount: Generates a query expression for matching a...

View source: R/expressionFromAttributeValuesCount.R

expressionFromAttributeValuesCountR Documentation

Generates a query expression for matching a transcript/participant attribute, for use with getMatches

Description

This function generates a query expression fragment which can be passed as the transcript.expression or participant.expression parameter of getMatches, (or the expression parameter of getMatchingTranscriptIds or getMatchingParticipantIds) matching by the number of values for a given attribute.

Usage

expressionFromAttributeValuesCount(
  transcript.attribute,
  comparison = "==",
  count
)

Arguments

transcript.attribute

The transcript attribute to filter by.

comparison

A string representing the operator to use for comparison, one of "<", "<=", "==", "!=", ">=", ">".

count

The number to compare the count of values to.

Details

The attribute defined by transcript.attribute is expected to have possibly more than one value, although single-value attributes may have 0 or 1 values, and this function can be used to distinguish these two possibilities as well.

Value

A transcript query expression which can be passed as the transcript.expression parameter of getMatches or the expression parameter of getMatchingTranscriptIds

See Also

expressionFromAttributeValues

expressionFromTranscriptTypes

expressionFromIds

getMatches

Examples

## Not run: 
## Search only transcripts including multilingual participants
results <- getMatches(labbcat.url, list(segment="I"),
                      participant.expression = expressionFromAttributeValuesCount(
                            "participant_languages", ">=", 2))

## Search only transcripts with no restrictions specified
results <- getMatches(labbcat.url, list(segment="I"),
                      transcript.expression = expressionFromAttributeValuesCount(
                            "transcript_restrictions", "==", 0))

## End(Not run)

nzilbb.labbcat documentation built on June 8, 2025, 10:57 a.m.