Mirror of the 512mb.org bot on github (https://github.com/512mb-org/512mb.org-bot)
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
11 lines
290 B
11 lines
290 B
markov = require("markov")
|
|
json = require("json")
|
|
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()
|
|
print(a)
|
|
preset:write(json.encode(a))
|
|
preset:close()
|