csv import now looks for text column

This commit is contained in:
Brett O'Connor 2014-05-03 16:44:07 -06:00
parent f80e84189a
commit 2aac54c7aa
3 changed files with 5 additions and 3 deletions

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}"