changed to different discord API

This commit is contained in:
christian
2021-12-05 13:33:53 +01:00
parent 45308b5d65
commit 29d1f280b7
2 changed files with 93 additions and 93 deletions
@@ -633,23 +633,27 @@ public class Datahandler {
stanfordCoreNLP.annotate(pipelineCoreDcoument);
stanfordCoreNLPSentiment.annotate(pipelineCoreDcoumentLastMsg);
String regex = "(.*?\\d){10,}";
for (CoreEntityMention em : pipelineCoreDcoument.entityMentions()) {
String entityType = em.entityType();
if (entityType == "PERSON") {
String str = responseMsg;
String emText = em.text();
Pattern pattern = Pattern.compile(regex);
Matcher matcher = pattern.matcher(personName);
boolean isMatched = matcher.matches();
if (emText != personName && !isMatched) {
for (CoreEntityMention emLastMsg : pipelineCoreDcoumentLastMsg.entityMentions()) {
if (emText != emLastMsg.text() && !Character.isDigit(Integer.parseInt(emLastMsg.text().trim()))) {
str = (responseMsg.substring(0, responseMsg.indexOf(emText)) + " "
+ emLastMsg + " " + responseMsg.substring(responseMsg.indexOf(emText)));
if (pipelineCoreDcoument.entityMentions() != null) {
for (CoreEntityMention em : pipelineCoreDcoument.entityMentions()) {
String entityType = em.entityType();
if (entityType == "PERSON") {
String str = responseMsg;
String emText = em.text();
Pattern pattern = Pattern.compile(regex);
Matcher matcher = pattern.matcher(personName);
boolean isMatched = matcher.matches();
if (emText != personName && !isMatched) {
if (pipelineCoreDcoumentLastMsg.entityMentions() != null) {
for (CoreEntityMention emLastMsg : pipelineCoreDcoumentLastMsg.entityMentions()) {
if (emText != emLastMsg.text() && !Character.isDigit(Integer.parseInt(emLastMsg.text().trim()))) {
str = (responseMsg.substring(0, responseMsg.indexOf(emText)) + " "
+ emLastMsg + " " + responseMsg.substring(responseMsg.indexOf(emText)));
}
}
}
str += personName;
return str;
}
str += personName;
return str;
}
}
}