removed global variable entirely
This commit is contained in:
@@ -39,7 +39,6 @@ public class Datahandler {
|
||||
private var pipelineSentimentAnnotationCache = HashMap<String, Annotation>()
|
||||
private var coreDocumentAnnotationCache: HashMap<String, CoreDocument>
|
||||
private var jmweAnnotationCache = HashMap<String, Annotation>()
|
||||
private var stringCache = ArrayList<String>()
|
||||
|
||||
//private val nerModel = "edu/stanford/nlp/models/ner/english.all.3class.caseless.distsim.crf.ser.gz"
|
||||
private val nerModel = "edu/stanford/nlp/models/ner/english.all.3class.distsim.crf.ser.gz"
|
||||
@@ -154,14 +153,6 @@ public class Datahandler {
|
||||
return StanfordCoreNLP(propsSentiment)
|
||||
}
|
||||
|
||||
fun updateStringCache() {
|
||||
stringCache = ArrayList<String>();
|
||||
for (str: String in DataMapper.getAllStrings()) {
|
||||
stringCache.add(str)
|
||||
}
|
||||
stringCache.sortWith(Comparator.comparingInt(String::length).reversed());
|
||||
}
|
||||
|
||||
private fun trimString(str: String): String {
|
||||
var message = str.trim { it <= ' ' }
|
||||
if (message.startsWith("<@")) {
|
||||
@@ -204,7 +195,7 @@ public class Datahandler {
|
||||
stanfordCoreNLP.annotate(annotation)
|
||||
val coreDocument = CoreDocument(annotation)
|
||||
|
||||
val values_copy: List<String> = ArrayList(stringCache)
|
||||
val values_copy: List<String> = ArrayList(DataMapper.getAllStrings())
|
||||
var preRelationUserCounters = -155000.0
|
||||
val concurrentRelations: MutableList<String> = arrayListOf()
|
||||
val SB = StringBuilder()
|
||||
@@ -541,8 +532,6 @@ public class Datahandler {
|
||||
if (preRelationUserCounters > cacheRequirement && !values_copy.contains(strF) && filterContent(strF)) {
|
||||
DataMapper.InsertMYSQLStrings(strF)
|
||||
DataMapper.checkStringsToDelete();
|
||||
stringCache.add(strF)
|
||||
stringCache.sortWith(Comparator.comparingInt(String::length).reversed());
|
||||
}
|
||||
val randomLenghtPermit = strF.length * (Math.random() * Math.random() * Math.random() * (Math.random() * 10))
|
||||
Collections.reverse(concurrentRelations)
|
||||
|
||||
@@ -72,7 +72,6 @@ public class DoStuff {
|
||||
}
|
||||
if (mentionedBot || channelName.contains("general-autism")) {
|
||||
String ResponseStr;
|
||||
System.out.println("reached datahandler.getResponseMsg");
|
||||
ResponseStr = datahandler.getResponseMsg(content, username, stanfordCoreNLP, stanfordCoreNLPSentiment,
|
||||
false);
|
||||
if (!ResponseStr.isEmpty()) {
|
||||
|
||||
Reference in New Issue
Block a user