Fuzzy match a term (case-insensitive) to a list of final terms through a translation enum.
.match_term(
term,
term_options,
final_terms,
default_term = NULL,
term_name = "metric",
human_terms = NULL,
named_options = TRUE,
call = rlang::caller_env()
)list where term = matched term & id = index in final_terms
A string to match
A named vector to map input terms to final terms in the form c("term1" = index in final_terms). Indices can be duplicated.
A vector of final acceptable terms.
A default term to use if nothing is found. If NULL, errors on no match.
The human name of the term (e.g. metric, operator...).
An optional list of acceptable terms for humans to use (may differ from final terms but should be present in term_options)
Whether term_options has been provided as a named vector or merely a normal character vector. (Liable to be removed)
The env from which this was called (defaults to the direct calling environment).