Merge pull request #13 from negatendo/master

csv import now looks for text column
This commit is contained in:
Mispy 2014-05-07 16:44:15 +10:00
commit 125b3c3b17
3 changed files with 5 additions and 3 deletions

View file

@ -1,4 +1,4 @@
# twitter\_ebooks 2.2.4
# twitter\_ebooks 2.2.5
Rewrite of my twitter\_ebooks code. While the original was solely a tweeting Markov generator, this framework helps you build any kind of interactive twitterbot which responds to mentions/DMs. See [ebooks\_example](https://github.com/mispy/twitter_ebooks) for an example of a full bot.

View file

@ -29,8 +29,10 @@ module Ebooks
end
elsif path.split('.')[-1] == "csv"
log "Reading CSV corpus from #{path}"
header = CSV.read(path).first
text_col = header.index('text')
lines = CSV.read(path).drop(1).map do |tweet|
tweet[5]
tweet[text_col]
end
else
log "Reading plaintext corpus from #{path}"

View file

@ -1,3 +1,3 @@
module Ebooks
VERSION = "2.2.4"
VERSION = "2.2.5"
end