添加 nbnhhsh 模型对 [inputting]"可能的" 支持

This commit is contained in:
A.C.Sukazyo Eyre 2022-01-16 09:47:57 +08:00
parent c6c9f2b0e9
commit 07f111a6e7
Signed by: Eyre_S
GPG Key ID: EFB47D98FE082FAD
4 changed files with 15 additions and 5 deletions

View File

@ -1,6 +1,6 @@
## Core
VERSION = 0.4.3.4
VERSION = 0.4.3.5
# dependencies

View File

@ -4,6 +4,6 @@ package cc.sukazyo.cono.morny;
* the final field that will be updated by gradle automatically.
*/
public class GradleProjectConfigures {
public static final String VERSION = "0.4.3.4";
public static final long COMPILE_TIMESTAMP = 1642273245554L;
public static final String VERSION = "0.4.3.5";
public static final long COMPILE_TIMESTAMP = 1642297552612L;
}

View File

@ -28,11 +28,20 @@ public class Nbnhhsh {
StringBuilder message = new StringBuilder("<a href=\"https://lab.magiconch.com/nbnhhsh/\">## Result of nbnhhsh query :</a>");
for (NbnhhshQuery.Word word : response.words) {
if (word.trans == null) continue;
if (word.trans != null && word.trans.length == 0) word.trans = null;
if (word.inputting != null && word.inputting.length == 0) word.inputting = null;
if (word.trans == null && word.inputting == null) continue;
message.append("\n\n<b>[[ ").append(escapeHtml(word.name)).append(" ]]</b>");
for (String trans : word.trans) {
if (word.trans != null) for (String trans : word.trans) {
message.append("\n* <i>").append(escapeHtml(trans)).append("</i>");
}
if (word.inputting != null) {
if (word.trans != null) message.append("\n");
message.append(" maybe:");
for (String trans : word.inputting) {
message.append("\n` <i>").append(escapeHtml(trans)).append("</i>");
}
}
}
MornyCoeur.extra().exec(new SendMessage(

View File

@ -16,6 +16,7 @@ public class NbnhhshQuery {
public static class Word {
public String name;
public String[] trans;
public String[] inputting;
}
public static class GuessResult {