Compare commits

..

2 Commits

2 changed files with 11 additions and 4 deletions

View File

@ -152,7 +152,14 @@ local markov = command("markov",{
return
end
markov_instance:load_state(preset)
local output = markov_instance:run("The",100)
local first_word = ""
for k,v in pairs(preset) do
first_word = k
if math.random(1,10) == 5 then
break
end
end
local output = markov_instance:run(first_word,100)
msg:reply(output)
end
})

View File

@ -1,8 +1,8 @@
markov = require("markov")
json = require("json")
text = [[
]]
text_file = io.open("input",'r')
text = text_file:read("*a")
text_file:close()
markov_instance = markov.new(text)
preset = io.open("new_preset.json","w")
a = markov_instance:save_state()