twitter_ebooks 3.1.5 ā 3.1.6
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/lib/twitter_ebooks/model.rb +3 -3
- data/lib/twitter_ebooks/suffix.rb +1 -1
- data/lib/twitter_ebooks/version.rb +1 -1
- data/spec/model_spec.rb +14 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d2d114305c41bbf4934a1bd79074465a43566c69
|
4
|
+
data.tar.gz: adef368c98fc584470fc8a509a460910c271011c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0e712a66f06e8f7bf6cf8c0d67da49468e22444e510e333d232e457793152f7889aa3fe579feb76f440ebb23efc88087f6c936331711a952445b8c9fca40eeaf
|
7
|
+
data.tar.gz: d980cfc21d023ae4c452d56b5589776480e747c1a36f25d376ee98f5f62ab608c471d400d1be4e85b2b42bc5804cbcb5bfe06bcca07b618c979cc3f287a9ef32
|
data/lib/twitter_ebooks/model.rb
CHANGED
@@ -183,7 +183,7 @@ module Ebooks
|
|
183
183
|
|
184
184
|
lines = nil; statements = nil; mentions = nil # Allow garbage collection
|
185
185
|
|
186
|
-
log "Tokenizing #{text.count(
|
186
|
+
log "Tokenizing #{text.count("\n")} statements and #{mention_text.count("\n")} mentions"
|
187
187
|
|
188
188
|
@sentences = mass_tikify(text)
|
189
189
|
@mentions = mass_tikify(mention_text)
|
@@ -254,7 +254,7 @@ module Ebooks
|
|
254
254
|
tweet = ""
|
255
255
|
|
256
256
|
while (tikis = generator.generate(3, :bigrams)) do
|
257
|
-
log "Attempting to produce tweet try #{retries+1}/#{retry_limit}"
|
257
|
+
#log "Attempting to produce tweet try #{retries+1}/#{retry_limit}"
|
258
258
|
break if (tikis.length > 3 || responding) && valid_tweet?(tikis, limit)
|
259
259
|
|
260
260
|
retries += 1
|
@@ -262,7 +262,7 @@ module Ebooks
|
|
262
262
|
end
|
263
263
|
|
264
264
|
if verbatim?(tikis) && tikis.length > 3 # We made a verbatim tweet by accident
|
265
|
-
log "Attempting to produce unigram tweet try #{retries+1}/#{retry_limit}"
|
265
|
+
#log "Attempting to produce unigram tweet try #{retries+1}/#{retry_limit}"
|
266
266
|
while (tikis = generator.generate(3, :unigrams)) do
|
267
267
|
break if valid_tweet?(tikis, limit) && !verbatim?(tikis)
|
268
268
|
|
data/spec/model_spec.rb
CHANGED
@@ -70,5 +70,19 @@ describe Ebooks::Model do
|
|
70
70
|
|
71
71
|
file.unlink
|
72
72
|
end
|
73
|
+
|
74
|
+
it 'handles strange unicode edge-cases' do
|
75
|
+
file = Tempfile.new('unicode')
|
76
|
+
file.write("š\nš")
|
77
|
+
file.close
|
78
|
+
|
79
|
+
model = Ebooks::Model.consume(file.path)
|
80
|
+
expect(model.mentions.count).to eq 0
|
81
|
+
expect(model.sentences.count).to eq 2
|
82
|
+
|
83
|
+
file.unlink
|
84
|
+
|
85
|
+
p model.make_statement
|
86
|
+
end
|
73
87
|
end
|
74
88
|
end
|
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: 3.1.
|
4
|
+
version: 3.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jaiden Mispy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-01-
|
11
|
+
date: 2016-01-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|