mirror of https://github.com/velour/catbase.git
fact: don't look for is actions
This commit is contained in:
parent
d1986be68a
commit
6707902caf
|
@ -90,21 +90,8 @@ func New(botInst bot.Bot) *FactoidPlugin {
|
||||||
|
|
||||||
// findAction simply regexes a string for the action verb
|
// findAction simply regexes a string for the action verb
|
||||||
func findAction(message string) string {
|
func findAction(message string) string {
|
||||||
r, err := regexp.Compile("<.+?>")
|
r := regexp.MustCompile("<.+?>")
|
||||||
if err != nil {
|
return r.FindString(message)
|
||||||
panic(err)
|
|
||||||
}
|
|
||||||
action := r.FindString(message)
|
|
||||||
|
|
||||||
if action == "" {
|
|
||||||
if strings.Contains(message, " is ") {
|
|
||||||
return "is"
|
|
||||||
} else if strings.Contains(message, " are ") {
|
|
||||||
return "are"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return action
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// learnFact assumes we have a learning situation and inserts a new fact
|
// learnFact assumes we have a learning situation and inserts a new fact
|
||||||
|
|
Loading…
Reference in New Issue