I am trying to initialize the Stanford NLP Part of Speech tagger and I keep getting a java.lang.IncompatibleClassChangeError. When I print the cause of the error, I get null, when I print the message I get Implementing Class.
This is my code:
try {
MaxentTagger tagger = new MaxentTagger(path+"left3words-wsj-0-18.tagger");
Reader reader = new BufferedReader(new InputStreamReader(System.in));
List<Sentence<? extends HasWord>> sentences = MaxentTagger.tokenizeText(reader);
for (Sentence<? extends HasWord> sentence : sentences) {
Sentence<TaggedWord> tSentence = MaxentTagger.tagSentence(sentence);
System.out.println(tSentence.toString(false));
}
} catch (IOException e) {
System.err.println("READ ERROR");
e.printStackTrace();
} catch (Exception e) {
System.err.println("TAGGER ERROR");
e.getMessage();
} catch(java.lang.IncompatibleClassChangeError e){
e.getStackTrace();
}
}
Does anyone know how to fix this?