Amal
Amal

Reputation: 21

exception in stanford library with Java

I was working on java project to extract subject,predicate,object from text using Stanford nlp library. I have written this code

Properties props = new Properties();
props.put("annotators", "tokenize, ssplit, pos, lemma, ner, parse, dcoref");
StanfordCoreNLP pipeline = new StanfordCoreNLP(props);
String text = "the quick fox jumps over the lazy dog";

Annotation document = new Annotation(text);

pipeline.annotate(document);

List<CoreMap> sentences = document.get(SentencesAnnotation.class);

for (CoreMap sentence: sentences) {
    for (CoreLabel token: sentence.get(TokensAnnotation.class)) {
        String word = token.get(TextAnnotation.class);
        String pos = token.get(PartOfSpeechAnnotation.class);
        String ne = token.get(NamedEntityTagAnnotation.class);
    }
    Tree tree = sentence.get(TreeAnnotation.class);

    SemanticGraph dependencies = 
        sentence.get(CollapsedCCProcessedDependenciesAnnotation.class);
}

Map<Integer, CorefChain> graph = document.get(CorefChainAnnotation.class);

I have this exception:

Exception in thread "main" java.lang.NoClassDefFoundError: de/jollyday/HolidayManager.
 at test_ir.Main.main(Main.java:88)
Caused by: java.lang.ClassNotFoundException: de.jollyday.HolidayManager

Upvotes: 0

Views: 958

Answers (1)

peter.petrov
peter.petrov

Reputation: 39437

Make sure the jollyday jar file is on your classpath at runtime. This should fix your problem.

You can download it from here: http://sourceforge.net/projects/jollyday/

Upvotes: 2

Related Questions