diff --git a/ArtificialAutism/src/main/java/FunctionLayer/Datahandler.java b/ArtificialAutism/src/main/java/FunctionLayer/Datahandler.java index dd99bd10..0d53dff2 100644 --- a/ArtificialAutism/src/main/java/FunctionLayer/Datahandler.java +++ b/ArtificialAutism/src/main/java/FunctionLayer/Datahandler.java @@ -198,11 +198,15 @@ public class Datahandler { private void createStrAnnotation(String str, StanfordCoreNLP stanfordCoreNLP, Boolean sentimentBool) { Annotation strAnno2 = new Annotation(str); strAnno2.compact(); - stanfordCoreNLP.annotate(strAnno2); - if (sentimentBool) { - pipelineSentimentAnnotationCache.put(str, strAnno2); - } else { - pipelineAnnotationCache.put(str, strAnno2); + try { + stanfordCoreNLP.annotate(strAnno2); + if (sentimentBool) { + pipelineSentimentAnnotationCache.put(str, strAnno2); + } else { + pipelineAnnotationCache.put(str, strAnno2); + } + } catch (Exception e) { + System.out.println("stanfordcorenlp annotate failed" + e.getMessage()); } }