Matches surface phrases in utterance text and outputs counts, plus dataset summary and run metadata. Supports simple wildcards in phrases: * (any chars), ? (one char). Normalization is per number of utterances.
phrase_counts(
phrases,
collection = NULL,
language = NULL,
corpus = NULL,
age = NULL,
sex = NULL,
role = NULL,
role_exclude = NULL,
wildcard = FALSE,
ignore_case = TRUE,
normalize = FALSE,
per_utts = 10000L,
db_version = "current",
cache = FALSE,
cache_dir = NULL,
output_file = NULL
)If output_file is NULL, returns a tibble of phrase counts; otherwise writes an Excel file and returns the file path (invisibly).
Character vector of phrases or patterns.
CHILDES filters.
Logical; enable * and ? in phrases.
Logical; case-insensitive matching.
Logical; if TRUE, add per-N utterance rates.
Integer; denominator for utterance rates (default 10000).
CHILDES DB version (recorded).
Logical; cache CHILDES queries on disk.
Optional cache directory.
Optional .xlsx path; if NULL, returns a tibble.
Tier targeting is not applied in phrase mode. Phrases are matched in
the main utterance text. For tier-constrained contexts around words, use
contexts_for(..., mode = "word", tier = "mor").