Skip to content

Commit

Permalink
pass tidy HTML tests #272
Browse files Browse the repository at this point in the history
  • Loading branch information
Andreas Blätte authored and Andreas Blätte committed Oct 28, 2023
1 parent 6c47f56 commit 6d01cc5
Show file tree
Hide file tree
Showing 19 changed files with 40 additions and 33 deletions.
2 changes: 1 addition & 1 deletion R/S4classes.R
Original file line number Diff line number Diff line change
Expand Up @@ -1011,7 +1011,7 @@ setClass("press_subcorpus", contains = "subcorpus")
#' \code{\link{regions}} class (which inherits from the and the
#' \code{\link{corpus}} class), without adding further slots.
#' @family classes to manage corpora
#' @name phrases
#' @name phrases-class
#' @rdname phrases-class
#' @aliases phrases-class
#' @examples
Expand Down
4 changes: 2 additions & 2 deletions R/corpus.R
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,8 @@ setMethod("corpus", "missing", function(){
#' includes undefined s-attributes, a warning is issued and the return value
#' is `NULL`.
#' @rdname subset
#' @name subset
#' @aliases subset,corpus-method
#' @name subset-method
#' @aliases subset subset,corpus-method
#' @seealso The methods applicable for the `subcorpus` object resulting from
#' subsetting a corpus or subcorpus are described in the documentation of the
#' `\link{subcorpus-class}`. Note that the `subset`-method can also be applied
Expand Down
2 changes: 2 additions & 0 deletions R/decode.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#' @name decode-method
#' @aliases decode
#' @rdname decode
setGeneric("decode", function(.Object, ...) standardGeneric("decode"))

Expand Down
3 changes: 2 additions & 1 deletion R/highlight.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ NULL
#' vectors of terms (or regular expressions); the name needs to be a
#' valid color name. It is also possible to pass in a `matrix` with ranges (as
#' returned by `cpos()`).
#' @name highlight
#' @name highlight-method
#' @aliases highlight
#' @rdname highlight
#' @exportMethod highlight
#' @examples
Expand Down
6 changes: 3 additions & 3 deletions R/href.R
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#' Add hypertext reference to html document.
#'
#'
#'
#' @param x Object of class 'html'.
#' @param href A named `list` with hypertext references that will be inserted as
#' attribute href of a elements. The names of the list are either colors of
#' highlighted text that has been generated previously, or corpus positions.
#' @export
#' @inheritParams tooltips
#' @inheritParams tooltips-method
#' @name href-function
#' @aliases href
#' @examples
#' use(pkg = "RcppCWB", corpus = "REUTERS")
#'
Expand Down
15 changes: 7 additions & 8 deletions R/phrases.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
setGeneric("as.phrases", function(.Object, ...) standardGeneric("as.phrases"))


#' @details If \code{.Object} is an object of class \code{ngrams}, the
#' \code{as.phrases}-method will interpret the ngrams as CQP queries,
#' look up the matching corpus positions and return an \code{phrases}
#' @details If `.Object` is an object of class `ngrams`, the
#' `as.phrases()`-method will interpret the ngrams as CQP queries,
#' look up the matching corpus positions and return an `phrases`
#' object.
#' @param .Object Input object, either a \code{ngrams} or a \code{matrix} object.
#' @param .Object Input object, either a `ngrams` or a `matrix` object.
#' @param enc Encoding of the corpus.
#' @param x A \code{phrases} class object.
#' @param x A `phrases` class object.
#' @param p_attribute The positional attribute (p-attribute) to decode.
#' @param phrases A \code{phrases} class object.
#' @param phrases A `phrases` class object.
#' @rdname phrases-class
#' @aliases as.phrases
#' @aliases phrases as.phrases
#' @export
#' @examples
#' use(pkg = "RcppCWB", corpus = "REUTERS")
Expand All @@ -26,7 +26,6 @@ setGeneric("as.phrases", function(.Object, ...) standardGeneric("as.phrases"))
#' as.phrases()
#'
#' phr <- as.character(reuters_phrases, p_attribute = "word")
#'
setMethod("as.phrases", "ngrams", function(.Object){
# First, prepare data.table with token id representation of phrases to look up
li <- lapply(
Expand Down
2 changes: 1 addition & 1 deletion R/read.R
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ NULL
#' @param type the partition type, see documentation for `partition()`-method
#' @param cutoff maximum number of tokens to display
#' @param ... Further parameters passed into `read()`.
#' @inheritParams href
#' @inheritParams href-function
#' @exportMethod read
#' @rdname read-method
#' @examples
Expand Down
2 changes: 1 addition & 1 deletion R/token_stream.R
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ NULL
setGeneric("get_token_stream", function(.Object, ...) standardGeneric("get_token_stream"))


#' @inheritParams decode
#' @inheritParams decode-method
#' @param registry Registry directory with registry file describing the corpus.
#' @rdname get_token_stream-method
setMethod("get_token_stream", "numeric", function(.Object, corpus, registry = NULL, p_attribute, subset = NULL, boost = NULL, encoding = NULL, collapse = NULL, beautify = TRUE, cpos = FALSE, cutoff = NULL, decode = TRUE, ...){
Expand Down
7 changes: 4 additions & 3 deletions R/tooltips.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ NULL
#' @param verbose A `logical` value, whether to show messages.
#' @param ... Further arguments are interpreted as assignments of tooltips to
#' tokens.
#' @name tooltips
#' @name tooltips-method
#' @aliases tooltips
#' @rdname tooltips
#' @exportMethod tooltips
#' @importFrom grDevices colors
Expand All @@ -37,9 +38,9 @@ NULL
#' html() %>%
#' highlight(yellow = c("barrels", "oil", "gas")) %>%
#' tooltips(list(yellow = "energy"))
setGeneric("tooltips", function(.Object, tooltips, ...){
setGeneric("tooltips", function(.Object, tooltips, ...)
standardGeneric("tooltips")
})
)



Expand Down
2 changes: 1 addition & 1 deletion man/corpus-class.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion man/decode.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion man/highlight.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion man/href.Rd → man/href-function.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions man/phrases-class.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/ranges_class.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/regions_class.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/subcorpus-class.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion man/subset.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion man/tooltips.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6d01cc5

Please sign in to comment.