tests/testthat/test-getAnchors.R

labbcat.url <- "https://labbcat.canterbury.ac.nz/demo"

test_that("getAnchors works", {
    skip_on_cran() # don't run tests that depend on external resource on CRAN
    if (!is.null(labbcatCredentials(labbcat.url, "demo", "demo"))) skip("Server not available")

    orthography <- getAnnotations(
        labbcat.url, "UC427_ViktoriaPapp_A_ENG.eaf", "orthography", NULL, 20, 0)
    anchors <- getAnchors(labbcat.url, "UC427_ViktoriaPapp_A_ENG.eaf", orthography$startId)
    expect_equal(length(anchors$id), 20)
    expect_equal(length(anchors$offset), 20)
    expect_equal(length(anchors$confidence), 20)
    
    expect_false(is.numeric(anchors$id))
    expect_true(is.numeric(anchors$offset))
    expect_true(is.numeric(anchors$confidence))
})

Try the nzilbb.labbcat package in your browser

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

nzilbb.labbcat documentation built on July 26, 2023, 6:08 p.m.