# Generated by savvy: do not edit by hand
#
# Note:
# This wrapper file is named as `000-wrappers.R` so that this file is loaded
# first, which allows users to override the functions defined here (e.g., a
# print() method for an enum).
#' @useDynLib vibrrt, .registration = TRUE
#' @keywords internal
NULL
# Check class and extract the external pointer embedded in the environment
.savvy_extract_ptr <- function(e, class) {
if(is.null(e)) {
return(NULL)
}
if(inherits(e, class)) {
e$.ptr
} else {
msg <- paste0("Expected ", class, ", got ", class(e)[1])
stop(msg, call. = FALSE)
}
}
# Prohibit modifying environments
#' @export
`$<-.savvy_vibrrt__sealed` <- function(x, name, value) {
class <- gsub("__bundle$", "", class(x)[1])
stop(class, " cannot be modified", call. = FALSE)
}
#' @export
`[[<-.savvy_vibrrt__sealed` <- function(x, i, value) {
class <- gsub("__bundle$", "", class(x)[1])
stop(class, " cannot be modified", call. = FALSE)
}
#' Call vibrato tokenizer
#' @noRd
`vbrt` <- function(`x`, `sys_dic`, `user_dic`, `max_grouping_len`) {
.Call(savvy_vbrt__impl, `x`, `sys_dic`, `user_dic`, `max_grouping_len`)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.