tokens <- list(c("Hello", "world", "."),
c("This", "is", "an", "example", "." ),
c("This", "is", "a", "party", "!"))
names(tokens) <- c('1.1', '1.2', '2.1')
dtm <- nlp_cast_tokens(tokens)
Run the code above in your browser using DataLab