Error in `RTokenizer$from_file(path)`: from_file panicked.

test_that("Expect errors for wrong arguments", {
testthat::expect_error(bleu_sentence_ids(list(list(1,2,3), list(2,3,4)), list(1,2,3), weights=list(0.33, 0.33, 0.33)))
testthat::expect_error(bleu_sentence_ids(list(c(1,2,3), c(2,3,4)), c(1,2,3), weights=list(0.33, 0.33, 0.33)))
testthat::expect_error(bleu_sentence_ids(list(list(1,2,3), list(2,3,4)), list(1,2,3), weights=c(0.33, 0.33, 0.33)))
testthat::expect_error(bleu_corpus_ids(list(list(list(1,2,3), list(2,3,4))), list(list(1,2,3)), weights=list(0.33, 0.33, 0.33)))
testthat::expect_error(bleu_corpus_ids(list(list(c(1,2,3), c(2,3,4))), list(c(1,2,3)), weights=list(0.33, 0.33, 0.33)))
testthat::expect_error(bleu_corpus_ids(list(list(list(1,2,3), list(2,3,4))), list(list(1,2,3)), weights=c(0.33, 0.33, 0.33)))
test_that("Expect number for `bleu_sentence_ids`", {
testthat::expect_vector(bleu_sentence_ids(ref_corpus, cand_corpus, weights=c(0.25, 0.25, 0.25, 0.25)))
testthat::expect_vector(bleu_sentence_ids(ref_corpus, cand_corpus, n=4, smoothing="floor", epsilon=0.01))
testthat::expect_vector(bleu_sentence_ids(ref_corpus, cand_corpus, n=4, smoothing="add-k", k=1))
test_that("Expect number for `bleu_corpus_ids`", {
testthat::expect_vector(bleu_corpus_ids(list(list(c(1,2,3), c(2,3,4))), list(c(1,2,3)), weights=c(0.33, 0.33, 0.33)))
testthat::expect_vector(bleu_corpus_ids(ref_corpus, cand_corpus, weights=c(0.25, 0.25, 0.25, 0.25)))
testthat::expect_vector(bleu_corpus_ids(ref_corpus, cand_corpus, n=4, smoothing="floor", epsilon=0.01))
testthat::expect_vector(bleu_corpus_ids(ref_corpus, cand_corpus, n=4, smoothing="add-k", k=1))
result_nlreval <- bleu_corpus_ids(ref_corpus, cand_corpus, n=3)
result_nlreval <- bleu_corpus_ids(ref_corpus, cand_corpus, weights=c(0.3333, 0.3333, 0.3333))
result_nlreval <- bleu_corpus_ids(ref_corpus, cand_corpus, n=4, smoothing="add-k")
result_nlreval <- bleu_corpus_ids(ref_corpus, cand_corpus, n=4, smoothing="floor", epsilon=0.01)
result_nlreval <- bleu_sentence_ids(ref_corpus, cand_corpus, n=4, smoothing="floor", epsilon=0.01)
generate_random_vectors <- function(length, min, max, m=7) {
lapply(1:m, function(x) sample(min:max, length, replace = TRUE))
ref <- lapply(sample(5:20), generate_random_vectors, min=0, max=50000)
cand <- generate_random_vectors(10, min=0, max=50000, m=16)
testthat::expect_vector(bleu_corpus_ids(ref, cand, n=4, smoothing="floor", epsilon=0.01))
ref <- list("Hello everyone.", "Hello Planet", "Hello World")
test_that("Expect Errors with Tokenizer Functions", {

"Expect Errors with Tokenizer Functions"