BESPOKE CHANGES FOR ROBINBOT

This commit is contained in:
Joel McCoy
2015-01-19 12:50:26 -05:00
parent f0743ea887
commit 99edc86414
6 changed files with 22 additions and 37 deletions

16
bots.rb
View File

@@ -63,11 +63,10 @@ class BoodooBot
@attempts = 0
@followers = []
@following = []
@archive_path = "corpus/#{@original}.json"
@model_path = "model/#{@original}.model"
@archive_path = "corpus/robin.csv"
@model_path = "model/robin.model"
if can_run?
get_archive!
make_model!
else
missing_fields.each {|missing|
@@ -101,12 +100,6 @@ class BoodooBot
scheduler.interval @update_follows_interval do
follow_parity
end
scheduler.interval @refresh_model_interval do
log "Refreshing archive/model..."
get_archive!
make_model!
end
end
def on_message(dm)
@@ -229,8 +222,11 @@ class BoodooBot
def load_model!
return if @model
@model_path ||= "model/#{original}.model"
@corpus_path ||= "corpus/robin.csv"
@model_path ||= "model/robin.model"
log "Consuming corpus #{@corpus_path}"
Ebooks::Model.consume(@corpus_path).save(@model_path)
log "Loading model #{model_path}"
@model = Ebooks::Model.load(model_path)
end