dict = data.frame(string = c('good','bad','ugl*','nice','not pret*', ':)', ':('),
sentiment=c(1,-1,-1,1,-1,1,-1))
tc = create_tcorpus(c('The good, the bad and the ugly, is nice :) but not pretty :('))
tc$code_dictionary(dict)
tc$tokens
Run the code above in your browser using DataLab