R/utils.R

Defines functions read_tag_dictionary

read_tag_dictionary <-
function(dict) {
    it <- dict$iterator()
    tags <- words <- list()
    while(it$hasNext()) {
        w <- .jcall(it, "Ljava/lang/Object;", "next")
        words <- c(words, list(.jsimplify(w)))
        tags <- c(tags, list(dict$getTags(w)))
    }
    names(tags) <- unlist(words)
    tags
}

Try the openNLP package in your browser

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

openNLP documentation built on Oct. 30, 2019, 11:37 a.m.