grr stupid mistake

This commit is contained in:
Jaiden Mispy 2014-10-25 05:48:13 -07:00
parent 1f8ea676bd
commit 302ea0229d

View file

@ -8,18 +8,22 @@ require 'csv'
module Ebooks module Ebooks
class Model class Model
attr_accessor :hash, :sentences, :mentions, :keywords attr_accessor :hash, :tokens, :sentences, :mentions, :keywords
def self.consume(txtpath) def self.consume(txtpath)
Model.new.consume(txtpath) Model.new.consume(txtpath)
end end
def self.load(path) def self.load(path)
props = Marshal.load(File.open(path, 'rb') { |f| f.read }) model = Model.new
@tokens = props[:tokens] model.instance_eval do
@sentences = props[:sentences] props = Marshal.load(File.open(path, 'rb') { |f| f.read })
@mentions = props[:mentions] @tokens = props[:tokens]
@keywords = props[:keywords] @sentences = props[:sentences]
@mentions = props[:mentions]
@keywords = props[:keywords]
end
model
end end
def save(path) def save(path)