Clivern / wit-java

🗿Java Library For Wit.ai
https://wit.ai
Apache License 2.0
11 stars 2 forks source link

error with keyword "error" #80

Open sysoutch opened 1 year ago

sysoutch commented 1 year ago

wit.send() returns false with text "I get this error message in epsxe: "Missing render texture extension!"" however this is totally fine "I get this problem in epsxe: "Missing render texture extension!"" (replacing "error" with "problem") it's not a wit.ai issue, sentence is understood fine on their page and through curl.

It even fails when just writing a single word "error" ("err", "erro", "errror" <- all of them are fine, no issue here)

renamed the Entity from "errors" to "problems" - same issue.

my current dirty workaround: String messageRaw = event.getMessage().getContent().replaceAll("(?i)error", "errror");

sysoutch commented 1 year ago

could it be cause of line 76 in this script https://github.com/Clivern/wit-java/blob/master/src/main/java/com/clivern/wit/Wit.java where you are checking the response for "error"?

        if (this.response.equals("") || this.response.indexOf("error") > 0) {
            this.status = false;
        } else {
            this.status = true;
        }

Edit: Can confirm, with uncommenting the 2nd if check, the error doesn't occur anymore