Prepare html document to see full text.
html(object, ...)
# S4 method for class 'character'
html(object, corpus, height = NULL)
# S4 method for class 'partition'
html(
object,
meta = NULL,
cpos = TRUE,
verbose = FALSE,
cutoff = NULL,
charoffset = FALSE,
beautify = TRUE,
height = NULL,
...
)
# S4 method for class 'subcorpus'
html(
object,
meta = NULL,
cpos = TRUE,
verbose = FALSE,
cutoff = NULL,
charoffset = FALSE,
beautify = FALSE,
height = NULL,
...
)
# S4 method for class 'partition_bundle'
html(
object,
charoffset = FALSE,
beautify = TRUE,
height = NULL,
progress = TRUE,
...
)
# S4 method for class 'kwic'
html(object, i, s_attribute = NULL, type = NULL, verbose = FALSE)
# S4 method for class 'remote_subcorpus'
html(object, ...)The object the fulltext output will be based on.
Further parameters that are passed into as.markdown().
The ID of the corpus, a length-one character vector.
A character vector that will be inserted into the html as an
optional height of a scroll box.
Metadata to include in output, if NULL (default), the
s-attributes defining a partition will be used.
Length-one logical value, if TRUE (default), all
tokens will be wrapped by elements with id attribute indicating corpus
positions.
Length-one logical value, whether to output progress
messages.
An integer value, maximum number of tokens to decode
from token stream, passed into as.markdown().
Length-one logical value, if TRUE, character offset
positions are added to elements embracing tokens.
A logical value, if TRUE, whitespace before
interpunctuation will be removed.
Length-one logical value, whether to output progress bar.
An integer value: If object is a kwic-object,
the index of the concordance for which the fulltext is to be generated.
Structural attributes that will be used to define the partition where the match occurred.
The partition type.
Returns an object of class html as used in the 'htmltools' package.
Methods such as htmltools::html_print() will be available. The encoding
of the html document will be UTF-8 on all systems (including Windows).
Substitutions configured by option 'polmineR.mdsub' are applied to prevent presence of characters that would be misinterpreted as markdown formatting instructions.
If param charoffset} is TRUE“, character offset positions will be
added to tags that embrace tokens. This may be useful, if exported html
document is annotated with a tool that stores annotations with character
offset positions.
use(pkg = "RcppCWB", corpus = "REUTERS")
#> ✔ corpus loaded: REUTERS
P <- partition("REUTERS", places = "argentina")
#> ... get cpos and strucs
H <- html(P)
if (interactive()) H # show full text in viewer pane
# html-method can be used in a pipe
H <- partition("REUTERS", places = "argentina") %>% html()
#> ... get cpos and strucs
# use html-method to get full text where concordance occurrs
K <- kwic("REUTERS", query = "barrels")
H <- html(K, i = 1, s_attribute = "id")
#> ... get cpos and strucs
H <- html(K, i = 2, s_attribute = "id")
#> ... get cpos and strucs
for (i in 1L:length(K)) {
H <- html(K, i = i, s_attribute = "id")
if (interactive()){
show(H)
userinput <- readline("press 'q' to quit or any other key to continue")
if (userinput == "q") break
}
}
#> ... get cpos and strucs
#> ... get cpos and strucs
#> ... get cpos and strucs
#> ... get cpos and strucs
#> ... get cpos and strucs
#> ... get cpos and strucs
#> ... get cpos and strucs
#> ... get cpos and strucs
#> ... get cpos and strucs
#> ... get cpos and strucs
#> ... get cpos and strucs