quanteda (version 1.5.2)

pattern2list: Convert various input as pattern to a vector used in tokens_select, tokens_compound and kwic.

Description

Convert various input as pattern to a vector used in tokens_select, tokens_compound and kwic.

Usage

pattern2list(
  pattern,
  types,
  valuetype,
  case_insensitive,
  concatenator = "_",
  levels = 1,
  remove_unigram = FALSE,
  keep_nomatch = FALSE
)

Arguments

pattern

a character vector, list of character vectors, dictionary, or collocations object. See pattern for details.

valuetype

the type of pattern matching: "glob" for "glob"-style wildcard expressions; "regex" for regular expressions; or "fixed" for exact matching. See valuetype for details.

case_insensitive

ignore the case of dictionary values if TRUE

concatenator

concatenator that join multi-word expression in tokens object

levels

only used when pattern is a dictionary

remove_unigram

ignore single-word patterns if TRUE

See Also

pattern2id