should properly clear the arraylist in the hasmap

This commit is contained in:
christian 2021-12-09 12:04:36 +01:00
parent da92210753
commit 103fbe0eb5

View File

@ -593,8 +593,6 @@ public class Datahandler {
Collections.reverse(concurrentRelations);
ArrayList<String> mysqlUpdateLastUsed = new ArrayList();
if (!concurrentRelations.isEmpty()) {
boolean passedFirst = false;
int lastIter = 1;
for (String secondaryRelation : concurrentRelations) {
if (SB.toString().length() > randomLenghtPermit && !SB.toString().isEmpty()) {
break;
@ -605,12 +603,14 @@ public class Datahandler {
for (String strItr : orDefault) {
if (secondaryRelation.equalsIgnoreCase(strItr)) {
skip = true;
if (orDefault.size() >= concurrentRelations.size()) {
if (orDefault.size() + 3 >= concurrentRelations.size()) {
orDefault = new ArrayList<>();
} else if (orDefault.size() > 3) {
strResponses.put(strF, orDefault);
} else if (orDefault.size() > 5) {
double v = Math.random() * 10;
if (v > 8.6) {
orDefault = new ArrayList<>();
strResponses.put(strF, orDefault);
}
}
break;
@ -618,7 +618,7 @@ public class Datahandler {
}
if (skip) continue;
if (passedFirst && lastIter < concurrentRelations.size()) {
if (!SB.isEmpty()) {
String testSTR = SB.toString() + " " + secondaryRelation;
SentimentAnalyzerTest SMX = getReponseFuturesHelper(strF, testSTR, stanfordCoreNLP, stanfordCoreNLPSentiment,
coreMaps1, strAnno, strAnnoSentiment, coreDocument, tokenizeCountingF, taggedWordListF
@ -634,8 +634,6 @@ public class Datahandler {
break;
}
}
passedFirst = true;
lastIter++;
SB.append(secondaryRelation).append(" ");
mysqlUpdateLastUsed.add(secondaryRelation);