diff --git a/ArtificialAutism/src/main/java/FunctionLayer/Datahandler.java b/ArtificialAutism/src/main/java/FunctionLayer/Datahandler.java index d6ff766d..91025ce4 100644 --- a/ArtificialAutism/src/main/java/FunctionLayer/Datahandler.java +++ b/ArtificialAutism/src/main/java/FunctionLayer/Datahandler.java @@ -583,7 +583,7 @@ public class Datahandler { ArrayList concurrentRelations = new ArrayList(); StringBuilder SB = new StringBuilder(); List ues_copy = new ArrayList(DataMapper.getAllStrings()); - double preRelationUserCounters = -155000.0; + double preRelationUserCounters = -1.123456789; //System.out.println(ues_copy.toString()); ArrayList> futures = new ArrayList<>(); @@ -613,7 +613,8 @@ public class Datahandler { SentimentAnalyzerTest SMX = completed.get(); if (SMX == null) continue; double scoreRelationLastUserMsg = SMX.getScore(); - if (scoreRelationLastUserMsg > preRelationUserCounters) { + if (scoreRelationLastUserMsg > preRelationUserCounters + || preRelationUserCounters == -1.123456789) { preRelationUserCounters = scoreRelationLastUserMsg; concurrentRelations.add(SMX.getSecondaryString()); } @@ -758,12 +759,12 @@ public class Datahandler { DataMapper.InsertMYSQLStrings(strF); DataMapper.checkStringsToDelete(); } - double randomLenghtPermit = strF.length() * (Math.random() * Math.random() * (Math.random() * 10)); + //double randomLenghtPermit = strF.length() * (Math.random() * Math.random() * (Math.random() * 10)); Collections.reverse(concurrentRelations); ArrayList mysqlUpdateLastUsed = new ArrayList(); if (!concurrentRelations.isEmpty()) { for (String secondaryRelation : concurrentRelations) { - if (SB.toString().length() > randomLenghtPermit && !SB.toString().isEmpty()) { + if (SB.toString().length() > strF.length() * 3 && !SB.toString().isEmpty()) { break; } @@ -772,6 +773,7 @@ public class Datahandler { for (String strItr : orDefault) { if (secondaryRelation.equalsIgnoreCase(strItr)) { skip = true; + //wtf why does this exist. if (orDefault.size() + 3 >= concurrentRelations.size()) { orDefault = new ArrayList<>(); strResponses.put(strF, orDefault); @@ -786,7 +788,7 @@ public class Datahandler { } } if (skip) continue; - + /* if (!SB.isEmpty()) { String testSTR = SB.toString() + " " + secondaryRelation; SentimentAnalyzerTest SMX = getReponseFuturesHelper(strF, testSTR, stanfordCoreNLP, stanfordCoreNLPSentiment, @@ -798,10 +800,12 @@ public class Datahandler { , strTokenEntryGetPOSF, retrieveTGWListF, PairCounterF, TokensCounterF, stopWordLemmaF, nerEntitiesF , stopWordTokenF, entityTokenTagsF, nerEntitiesTypeF, AnotatorcounterF, strTokenStemsF); double scoreRelationLastUserMsg = SMX.getScore(); + if (preRelationUserCounters > scoreRelationLastUserMsg) { break; } - } + + } */ SB.append(secondaryRelation).append(" "); mysqlUpdateLastUsed.add(secondaryRelation);