q_collocations: Collocations to query match

Description Usage Arguments Value Examples

Description

q_collocations performs collocation analysis of a query match. If query match is longer than one token the context is build around the entire length of the query match. E.g. if context = 3, three tokens before the first token of the match and three tokens after the last token of the match are taken into account. In case two or more numeric collocation windows overlap, tokens are counted multiple times. However, if more than one match fall within a structural region, only unique structural regions are considered.

Usage

1
q_collocations(query_result, context, pattr = "word", exclude_match = T)

Arguments

query_result

list of class query result returned from query_corpus.

context

integer vector of length one: number of tokens around the query match. integer vector of length two: number of tokens to the left and right. character: structural attribute (e.g. "s").

pattr

character specifying positional attribute (e.g. "word").

exclude_match

logical indicating whether the matched tokens themselves should be excluded from the analysis.

Value

data.table of collocators and frequencies.

Examples

1
2
3
## Not run: q_collocations(my_query_result, context = 3)
  ## Not run: q_collocations(my_query_result, context = c(2, 0))
  ## Not run: q_collocations(my_query_result, context = "s", pattr = "lemma", exclude_match = F)

wiertz/rusecqp documentation built on Feb. 9, 2022, 1:30 p.m.