Learn R Programming

quanteda (version 0.99.22)

pattern2id: 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

pattern2id(pattern, types, valuetype, case_insensitive, concatenator = "_",
  remove_unigram = FALSE)

Arguments

pattern

a character vector, list of character vectors, dictionary, collocations, or dfm. 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

remove_unigram

ignore single-word patterns if TRUE

See Also

regex2id