tests/testthat/test_get_cbow_matrix.R

library(RcppCWB)
use_tmp_registry()
testthat::context("get_cbow_matrix")

test_that(
  "get_cbow_matrix",
  {
    M <- get_cbow_matrix(
      corpus = "REUTERS",
      p_attribute = "word",
      registry = get_tmp_registry(),
      matrix = matrix(c(0, 91), nrow = 1),
      window = 5
    )
    expect_equal(dim(M), c(92L, 11L))
  }
)

Try the RcppCWB package in your browser

Any scripts or data that you put into this service are public.

RcppCWB documentation built on July 9, 2023, 7:40 p.m.