Get cooccurrence statistics.
cooccurrences(.Object, ...)# S4 method for character
cooccurrences(.Object, query, cqp = is.cqp,
p_attribute = getOption("polmineR.p_attribute"), s_attribute = NULL,
left = getOption("polmineR.left"), right = getOption("polmineR.right"),
stoplist = NULL, positivelist = NULL, regex = FALSE, keep = NULL,
cpos = NULL, method = "ll", mc = getOption("polmineR.mc"),
verbose = FALSE, progress = FALSE, ...)
# S4 method for partition
cooccurrences(.Object, query, cqp = is.cqp,
left = getOption("polmineR.left"), right = getOption("polmineR.right"),
p_attribute = getOption("polmineR.p_attribute"), s_attribute = NULL,
stoplist = NULL, positivelist = NULL, keep = NULL, method = "ll",
mc = FALSE, progress = TRUE, verbose = FALSE, ...)
# S4 method for context
cooccurrences(.Object, method = "ll", verbose = FALSE)
# S4 method for partition_bundle
cooccurrences(.Object, query,
mc = getOption("polmineR.mc"), ...)
a partition object, or a character vector with a CWB corpus
further parameters that will be passed into bigmatrix (applies only of big=TRUE)
query, may by a character vector to match a token, or a CQP query
defaults to is.cqp
-function, or provide TRUE/FALSE, relevant only if query is not NULL
the p-attribute of the tokens/the query
if provided, it will be checked that cpos do not extend beyond the region defined by the s-attribute
no of tokens and to the left of the node word
no of tokens to the right of the node word
exclude a query hit from analysis if stopword(s) is/are in context (relevant only if query is nut NULL)
character vector or numeric vector: include a query hit only if token in positivelist is present. If positivelist is a character vector, it is assumed to provide regex expressions (incredibly long if the list is long) (relevant only if query is nut NULL)
logical, whether stoplist/positivelist are dealt with as regular expressions
list with tokens to keep
integer vector with corpus positions, defaults to NULL - then the corpus positions for the whole corpus will be used
statistical test to use (defaults to "ll")
whether to use multicore
logical, whether to be verbose
logical, whether to be verbose
a cooccurrences-class object
Baker, Paul (2006): Using Corpora in Discourse Analysis. London: continuum, p. 95-120 (ch. 5).
Manning, Christopher D.; Schuetze, Hinrich (1999): Foundations of Statistical Natural Language Processing. MIT Press: Cambridge, Mass., pp. 151-189 (ch. 5).
# NOT RUN {
use("polmineR")
merkel <- partition("GERMAPARLMINI", interjection = "speech", speaker = ".*Merkel", regex = TRUE)
merkel <- enrich(merkel, p_attribute = "word")
cooc <- cooccurrences(merkel, query = "Deutschland")
# }
Run the code above in your browser using DataLab