mirror of
https://github.com/thewesker/twitter_ebooks.git
synced 2025-12-20 12:21:11 -05:00
grr stupid mistake
This commit is contained in:
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user