as.Annotation.Rd
Decode Corpus as Annotation Object.
decode(x, type = c("word", "sentence"))
An object that can be processed by polmineR::get_token_stream.
polmineR::get_token_stream
Either "word" or "sentence".
An Annotation object.
Annotation
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"]] }