Learn R Programming

coreNLP (version 0.4-3)

annotateString: Annotate a string of text

Description

Runs the CoreNLP annotators over a given string of text. The details for which annotators to run and how to run them are specified in the properties file loaded in via the initCoreNLP function (which must be run prior to any annotation).

Usage

annotateString(text, format = c("obj", "xml", "text"), outputFile = NA,
  includeXSL = FALSE)

Arguments

text

a vector of strings for which an annotation is desired. Will be collapsed to length 1 using new line characters prior to the annotation.

format

the desired output format. Option obj, the default, returns an R object of class annotation and will likely be the desired choice for most users. The xml and text exist primarily for subsequently saving to disk.

outputFile

character string indicating where to put the output. If set to NA, the output will be returned by the function.

includeXSL

boolean. Whether the xml style sheet should be included in the output. Only used if format is xml and outputFile is not NA.

Examples

Run this code
if (FALSE) {
initCoreNLP()
sIn <- "Mother died today. Or, maybe, yesterday; I can't be sure."
annoObj <- annotateString(sIn)
}

Run the code above in your browser using DataLab