This commit is contained in:
Andreas Neue 2019-08-01 15:23:37 +02:00
parent 45ba50b132
commit 664d8bfcb3
1 changed files with 2 additions and 4 deletions

View File

@ -23,8 +23,6 @@ import (
"git.dnix.de/an/xlog" "git.dnix.de/an/xlog"
) )
var markovPrefixLen *int
var ( var (
//markovPrefixLen = flag.Int("markov_prefix_len", 3, "markov: prefix len") //markovPrefixLen = flag.Int("markov_prefix_len", 3, "markov: prefix len")
markovAnswerLen = flag.Int("markov_answer_len", 10, "markov: answer len") markovAnswerLen = flag.Int("markov_answer_len", 10, "markov: answer len")
@ -38,7 +36,6 @@ var markovChain *MarkovChain
func init() { func init() {
MsgFuncs["markov"] = markovHandleMessage MsgFuncs["markov"] = markovHandleMessage
RunFuncs["markov"] = markovRun RunFuncs["markov"] = markovRun
*markovPrefixLen = 3
} }
func markovHandleMessage(m *Message) { func markovHandleMessage(m *Message) {
@ -62,7 +59,8 @@ func markovHandleMessage(m *Message) {
} }
func markovRun() { func markovRun() {
markovChain = markovNewChain(*markovPrefixLen) //markovChain = markovNewChain(*markovPrefixLen)
markovChain = markovNewChain(3)
err := markovChain.Load(*markovStateFile) err := markovChain.Load(*markovStateFile)
if err != nil { if err != nil {
xlog.Error(err.Error()) xlog.Error(err.Error())