I have the following code:

TokenizerFactory tokenizerFactory = PTBTokenizer.factory(new CoreLabelTokenFactory(), "");

List rawWords2 = tokenizerFactory.getTokenizer(new

StringReader(Sentence)).tokenize();

Error Like:

Exception in thread "main" java.lang.ClassCastException:

edu.stanford.nlp.process.PTBTokenizer$PTBTokenizerFactory cannot be cast to

edu.stanford.nlp.objectbank.TokenizerFactory

So, How can I solve this one?

More Dr. Partha Pakray's questions See All
Similar questions and discussions