Decode Corpus as Annotation Object.

decode(x, type = c("word", "sentence"))

Arguments

x

An object that can be processed by polmineR::get_token_stream.

type

Either "word" or "sentence".

Value

An Annotation object.

Examples

if (FALSE) { use("RcppCWB") p <- partition("UNGA", date = "2018-03-20", who = "Al Hussein") s <- NLP::String(as.String(p)) a <- as.Annotation(p, type = "word") sent <- as.Annotation(p, type = "sentence") a1 <- c(sent, a) words <- s[a1[a1$type == "word"]] sentences <- s[a1[a1$type == "sentence"]] }