tests/testthat/test-unnest_ptb.R

test_that("unnest_ptb works", {
  d <- tibble(txt = janeaustenr::prideprejudice)
  r <- unnest_ptb(d, out, txt)
  s <- unnest_tokens(d, out, txt, token = "ptb")
  expect_equal(r, s)
  r <- unnest_ptb(skspr, out, txt)
  s <- unnest_tokens(skspr, out, txt, token = "ptb")
  expect_equal(r, s)
})

Try the tidytext package in your browser

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

tidytext documentation built on Jan. 8, 2023, 1:12 a.m.