changed to different discord API
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user