tried fixing error messages that were reported

This commit is contained in:
jenz 2023-02-10 16:55:47 +01:00
parent cb8c1f22f0
commit 845c6dd0c0
2 changed files with 20 additions and 6 deletions

View File

@ -282,10 +282,15 @@ public class Datahandler {
ArrayList<String> stopWordLemma1 = stopWordLemmaHashMap.getOrDefault(str1, null);
Integer PairCounter1 = PairCounterHashMap.getOrDefault(str1, null);
Annotation annotationStrPipeLine1 = pipelineAnnotationCache.get(str1);
Annotation annotationStrPipeLineSentiment1 = pipelineSentimentAnnotationCache.get(str1);
SentimentAnalyzerTest SMX = new SentimentAnalyzerTest(strF, str1,
coreMaps1, coreMaps2, strAnno,
pipelineAnnotationCache.get(str1), strAnnoSentiment,
pipelineSentimentAnnotationCache.get(str1), coreDocument, coreDocumentAnnotationCache.get(str1),
//sometimes Annotation(str) returns null so in that case better use result of sentiment
annotationStrPipeLine1 == null ? annotationStrPipeLineSentiment1 : annotationStrPipeLine1,
strAnnoSentiment,
annotationStrPipeLineSentiment1, coreDocument, coreDocumentAnnotationCache.get(str1),
tagger, gsf, classifier, tokenizeCounting, tokenizeCountingF,
taggedWordListF, taggedWordList1, retrieveTGWListF, retrieveTGWList1,
sentencesF, sentence1, sentencesSentimentF, sentenceSentiment1, treesF, trees1,
@ -710,9 +715,11 @@ public class Datahandler {
}
}
} catch (InterruptedException e) {
throw new RuntimeException(e);
//throw new RuntimeException(e);
--pending;
} catch (ExecutionException e) {
throw new RuntimeException(e);
//throw new RuntimeException(e);
--pending;
}
}

View File

@ -603,8 +603,15 @@ public class SentimentAnalyzerTest {
for (final Tree sentenceConstituencyParse1 : sentenceConstituencyParseList1) {
try {
if (sentenceConstituencyParse1 != null && !sentenceConstituencyParse1.isEmpty()) {
Set<Constituent> constinuent1 = Tdiff.markDiff(sentenceConstituencyParse1, sentenceConstituencyParse2);
Set<Constituent> constinuent2 = Tdiff.markDiff(sentenceConstituencyParse2, sentenceConstituencyParse1);
Set<Constituent> constinuent1 = null;
Set<Constituent> constinuent2 = null;
try {
constinuent1 = Tdiff.markDiff(sentenceConstituencyParse1, sentenceConstituencyParse2);
constinuent2 = Tdiff.markDiff(sentenceConstituencyParse2, sentenceConstituencyParse1);
} catch (Exception e) {
continue;
}
ArrayList<String> constiLabels = new ArrayList<String>();
for (final Constituent consti : constinuent1) {
for (final Constituent consti1 : constinuent2) {