diff --git a/AI.go b/AI.go index 17c6115..3b1eadd 100644 --- a/AI.go +++ b/AI.go @@ -75,21 +75,8 @@ func mitAI(info string) string { reply := new(mitReply) decoder := json.NewDecoder(resp.Body) decoder.Decode(reply) - log.Printf("reply from qingyunke machine: %s", reply.Responses[0]) + log.Printf("reply from mit machine: %s", reply.Responses[0]) return reply.Responses[0] - //body, err := ioutil.ReadAll(resp.Body) - //re, _ := regexp.Compile("Mitsuku:(.*?)

") - //all := re.FindSubmatch(body) - //if len(all) == 0 { - // return "change another question?" - //} - //found := (string(all[1])) - //log.Printf("reply from mitsuku machine: %s", found) - //wl := []string{`

`, " ", "
", "\n", "xloadswf2.", "", "Mitsuku", "samaritan"} - //srp := strings.NewReplacer(wl...) - //ret := srp.Replace(found) - //ret = strings.TrimLeft(ret, " ") - //return ret } type mitReply struct { diff --git a/AI_test.go b/AI_test.go index 268668a..eefe529 100644 --- a/AI_test.go +++ b/AI_test.go @@ -12,6 +12,6 @@ func TestAIReply(t *testing.T) { // t.Error("qinAI error") //} if mitAI(askEn) == "" || mitAI(askZh) == "" { - t.Error("tlAI error") + t.Error("mitAI error") } }