Skip to contents

From a dataframe with one row per context word of a token and columns for elements (in particular, word with the appropriate enrichment), create a concordance line.

Usage

getContext(
  tid,
  cws,
  foc_param = NA,
  weight_param = NA,
  cw_selection = NA,
  clean_word_fun = cleanWord,
  to_remove = c("<sentence>"),
  ...
)

Arguments

tid

Token ID.

cws

Dataframe with one row per context word per token, as outputted by setupConcordancer.

foc_param

Character string with information on first order filters.

weight_param

Character string with information on weighting filters.

cw_selection

List or character string of semicolon-separated values with the context words captured by the model.

clean_word_fun

Function to clean the word column.

to_remove

Vector of word values to remove altogether.

...

Arguments to be passed to filterFoc and filterWeight.

Value

Character string with (weighted) concordance line.

Examples

if (FALSE) {
cws <- setupConcordancer(lemma, input_dir)
getContext(tokenID, cws, 'bound5-5lex', 'PPMIweight', c('a/det', 'horse/noun', 'fast/adj'))
}