tests/testthat/test_phrasemachine.R

context("Main Function")
test_that("extract right spans", {

    test_result <- phrasemachine("Hello there my red good cat.",
                                 minimum_ngram_length = 1,
                                 maximum_ngram_length = 8,
                                 return_tag_sequences = TRUE)

    expect_equal(test_result[[1]]$phrases[1], "red_good_cat")
    expect_equal(test_result[[1]]$phrases[2], "good_cat")
    expect_equal(test_result[[1]]$phrases[3], "cat")
})

Try the phrasemachine package in your browser

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

phrasemachine documentation built on May 2, 2019, 8:23 a.m.