tests/testthat/test_get_ngrams_pos.R

context("Counting n-grams")

test_that("Count ngrams for different distances",{
  expect_equal(length(get_ngrams_ind(10, 2, 0)[[1]]), 9)
  expect_true(all(sapply(get_ngrams_ind(10, 3, 1), length) == 6))
})

Try the biogram package in your browser

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

biogram documentation built on March 31, 2020, 5:14 p.m.