Highlight tokens based on exact match, a regular expression or corpus position in kwic output or html document.

tooltips(.Object, tooltips, ...)

# S4 method for character
tooltips(.Object, tooltips = list())

# S4 method for html
tooltips(.Object, tooltips = list())

# S4 method for kwic
tooltips(.Object, tooltips, regex = FALSE, ...)

Arguments

.Object

A html or character object with html.

tooltips

A named list of character vectors, the names need to match colors in the list provided to param highlight. The value of the character vector is the tooltip to be displayed.

...

Further arguments are interpreted as assignments of tooltips to tokens.

regex

Logical, whether character vector values of argument tooltips are interpreted as regular expressions.

Examples

use("polmineR")
#> ... activating corpus: GERMAPARLMINI (version: 0.0.1 | build date: 2019-02-23)
#> ... activating corpus: REUTERS
P <- partition("REUTERS", places = "argentina")
#> ... get encoding: latin1
#> ... get cpos and strucs
H <- html(P) Y <- highlight(H, lightgreen = "higher") T <- tooltips(Y, list(lightgreen = "Further information")) if (interactive()) T # Using the tooltips-method in a pipe ... h <- P %>% html() %>% highlight(yellow = c("barrels", "oil", "gas")) %>% tooltips(list(yellow = "energy"))