Class to organize information of context analysis.
# S4 method for context length(x) # S4 method for context p_attributes(.Object) # S4 method for context count(.Object) # S4 method for context sample(x, size) # S4 method for context enrich( .Object, s_attribute = NULL, p_attribute = NULL, decode = FALSE, verbose = TRUE, ... ) # S4 method for context as.regions(x, node = TRUE) # S4 method for context trim( object, s_attribute = NULL, positivelist = NULL, p_attribute = p_attributes(object), regex = FALSE, stoplist = NULL, verbose = TRUE, progress = TRUE, ... )
| x | a context object |
|---|---|
| .Object | object |
| size | integer indicating sample size |
| s_attribute | s-attribute(s) to add to data.table in cpos-slot |
| p_attribute | p-attribute(s) to add to data.table in cpos-slot |
| decode | logical, whether to convert integer ids to expressive strings |
| verbose | logical, whether to be talkative |
| ... | to maintain backwards compatibility if argument |
| node | A logical value, whether to include the node (i.e. query matches) in the region matrix
generated when creating a |
| object | a context object |
| positivelist | tokens that are required to be present to keep a match |
| regex | logical, whether positivlist / stoplist is interpreted as regular expressions |
| stoplist | tokens that are used to exclude a match |
| progress | logical, whether to show progress bar |
Objects of the class context include a data.table in the
slot cpos. The data.table will at least include the columns "match_id",
"cpos" and "position".
The length-method will return the number of hits that were achieved.
The enrich-method can be used to add additional information to the data.table
in the "cpos"-slot of a context-object.
queryThe query examined (character).
countAn integer value, the number of hits for the query.
partitionThe partition the context object is based on.
size_partitionThe size of the partition, a length-one integer vector.
leftA length-one integer value, the number of tokens to the left of the query match.
rightAn integer value, the number of tokens to the right of the query match.
sizeA length-one integer value, the number of tokens covered by
the context-object, i.e. the number of tokens in the right and left context
of the node as well as query matches.
size_matchA length-one integer value, the number of tokens
matches by the query. Identical with the value in slot count if the query
is not a CQP query.
size_coiA length-one integer value, the number of tokens in the
right and left context of the node (excluding query matches).
size_refA length-one integer value, the number of tokens in the
partition, without tokens matched and the tokens in the left and right
context.
boundaryAn s-attribute (character).
p_attributeThe p-attribute of the query (character).
corpusThe CWB corpus used (character).
statA data.table, the statistics of the analysis.
encodingObject of class character, encoding of the corpus.
cposA data.table, with the columns match_id, cpos, position, word_id.
methodA character-vector, statistical test used.
callObject of class character, call that generated the object.