R/polarity.R

Defines functions QDAP_Polarity_Annotator

Documented in QDAP_Polarity_Annotator

QDAP_Polarity_Annotator <-
function()
{
    f <- function(s, a) {
        s <- as.String(s)
        a <- a[a$type == "sentence"]
        p <- polarity(s[a])$all$polarity
        a$features <- lapply(p, single_feature, "polarity")
        a
    }

    description <-
        "Sentence polarity annotator for English using qdap::polarity"

    Annotator(f, list(description = description))
}

Try the NLPutils package in your browser

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

NLPutils documentation built on May 31, 2023, 8:54 p.m.