twitter_ebooks 2.2.3 → 2.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/twitter_ebooks/model.rb +6 -0
- data/lib/twitter_ebooks/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 44b2c821431af8ccfff940cbb61d0ee25a80e08e
|
4
|
+
data.tar.gz: 48c61efe3f8fe3fe90a938e0ab09a6c66f2e8857
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c8612b1f211b3a6dc0ca4fbe8cb6068c5f7bc4e0cdecf4355f894e040729f1491803c21c04c201221238bf55c8593fcc77da4bb98be360031e2a6343b2c62552
|
7
|
+
data.tar.gz: 5897ad5f0136af37b9e71176daa57677963f4f503b4a42f02c6b266980c9a144fd901167e92e70ef12a7f3110902c0094a251f35792043d3d37db1f0e5468e6e
|
data/README.md
CHANGED
data/lib/twitter_ebooks/model.rb
CHANGED
@@ -4,6 +4,7 @@
|
|
4
4
|
require 'json'
|
5
5
|
require 'set'
|
6
6
|
require 'digest/md5'
|
7
|
+
require 'csv'
|
7
8
|
|
8
9
|
module Ebooks
|
9
10
|
class Model
|
@@ -26,6 +27,11 @@ module Ebooks
|
|
26
27
|
lines = JSON.parse(content, symbolize_names: true).map do |tweet|
|
27
28
|
tweet[:text]
|
28
29
|
end
|
30
|
+
elsif path.split('.')[-1] == "csv"
|
31
|
+
log "Reading CSV corpus from #{path}"
|
32
|
+
lines = CSV.read(path).drop(1).map do |tweet|
|
33
|
+
tweet[5]
|
34
|
+
end
|
29
35
|
else
|
30
36
|
log "Reading plaintext corpus from #{path}"
|
31
37
|
lines = content.split("\n")
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: twitter_ebooks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jaiden Mispy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-05-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|
@@ -192,7 +192,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
192
192
|
version: '0'
|
193
193
|
requirements: []
|
194
194
|
rubyforge_project:
|
195
|
-
rubygems_version: 2.2.
|
195
|
+
rubygems_version: 2.2.2
|
196
196
|
signing_key:
|
197
197
|
specification_version: 4
|
198
198
|
summary: Markov chains for all your friends~
|