R/formality.R

Defines functions QDAP_Formality_Annotator

Documented in QDAP_Formality_Annotator

QDAP_Formality_Annotator <-
function()
{
    f <- function(s, a) {
        s <- as.String(s)
        formality <- formality(s, progress.bar = FALSE)$formality$formality
        Annotation(.document_id(a),
                   "document",
                   1L,
                   nchar(s),
                   list(list(formality = formality)))
    }

    description <-
        "Document formality annotator for English using qdap::formality"

    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.