Class: Markovian::Importers::Twitter::CsvImporter

Inherits:
Object
  • Object
show all
Defined in:
lib/markovian/importers/twitter/csv_importer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ CsvImporter

Returns a new instance of CsvImporter.



11
12
13
# File 'lib/markovian/importers/twitter/csv_importer.rb', line 11

def initialize(path)
  @path = path
end

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path.



10
11
12
# File 'lib/markovian/importers/twitter/csv_importer.rb', line 10

def path
  @path
end

Instance Method Details

#corpusObject



20
21
22
# File 'lib/markovian/importers/twitter/csv_importer.rb', line 20

def corpus
  Corpus::Compiler.new.build_corpus(texts_for_markov_analysis)
end

#texts_for_markov_analysisObject



15
16
17
18
# File 'lib/markovian/importers/twitter/csv_importer.rb', line 15

def texts_for_markov_analysis
  # reject any blank tweets -- in our case, those with only a stripped-out URL
  tweet_enumerator.reject {|t| t.empty?}
end