S4 class for organizing information for concordance output
# S4 method for kwic
show(object)# S4 method for kwic
as.data.frame(x)
# S4 method for kwic
length(x)
# S4 method for kwic
sample(x, size)
# S4 method for kwic
enrich(.Object, meta = NULL, table = FALSE)
# S4 method for kwic
highlight(.Object, highlight = list(), regex = FALSE,
perl = TRUE, tooltips = NULL, verbose = TRUE)
# S4 method for kwic
view(.Object)
an object of class kwic
a kwic-class object
integer, the subset size for sampling
a kwic object
sAttributes (character vector) with metainformation
logical, whether to turn cpos data.table into data.frame for output
a list
logical, whether to use regular expressions
logical, whether to use perl-style regular expressions for highlighting when regex is TRUE
a list
logical
metadata
Object of class "character"
keeping the sAttributes of the metadata that are to be displayed
left
words to the left
right
words to the right
corpus
the CWB corpus
cpos
the corpus positions
table
Object of class "data.frame"
a table with the relevant information for kwic output
encoding
Object of class "character"
encoding of the corpus
labels
Object of class "character"
categories
Object of class "character"
indexing for seeing only some concordances
get kwic output
The enrich
method is used to generate the actual output for
the kwic method. If param table
is TRUE
, corpus positions will
be turned into a data.frame with the concordance lines. If param meta
is a character vector with s-attributes, the respective s-attributes will be
added as columns to the table with concordance lines.
# NOT RUN {
use("polmineR.sampleCorpus")
K <- kwic("PLPRBTTXT", "Integration")
length(K)
K[1]
K[1:5]
# }
Run the code above in your browser using DataLab