tests/testthat/test-collapse_tokens.R

### collapse_tokens ----
test_that("collapse_tokens works", {
  testdata <- readRDS(system.file("testdata/testdata.rda", package = "gibasa"))
  res <-
    testdata[["tokens"]] |>
    dplyr::slice_head(n = 36) |>
    prettify(col_select = "POS1") |>
    collapse_tokens(POS1 == "\u540d\u8a5e")
  expect_snapshot_value(res, style = "json2", cran = FALSE)
})

Try the gibasa package in your browser

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

gibasa documentation built on Sept. 11, 2024, 9:23 p.m.