context("derwent_extract")
test_that("number extract works", {
num <- derwent_extract(five_texts, "text", section = "number")
expect_named(num, c("doc_id", "text", "number"))
})
test_that("title extract works", {
num <- derwent_extract(five_texts, "text", section = "title")
expect_named(num, c("doc_id", "text", "title"))
})
test_that("abstract extract works", {
num <- derwent_extract(five_texts, "text", section = "abstract")
expect_named(num, c("doc_id", "text", "abstract"))
})
test_that("description extract works", {
num <- derwent_extract(five_texts, "text", section = "description")
expect_named(num, c("doc_id", "text", "description"))
})
test_that("claims extract works", {
num <- derwent_extract(five_texts, "text", section = "claims")
expect_named(num, c("doc_id", "text", "claims"))
})
test_that("tac extract works", {
num <- derwent_extract(five_texts, "text", section = "tac")
expect_named(num, c("doc_id", "text", "number", "title", "abstract", "claims"))
})
test_that("full extract works", {
num <- derwent_extract(five_texts, "text", section = "all")
expect_named(num, c("doc_id", "text", "number", "title", "abstract", "description", "claims"))
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.