zombie_writer 0.1.0 → 0.2.0
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 +8 -6
- data/lib/zombie_writer/version.rb +1 -1
- data/lib/zombie_writer.rb +13 -4
- 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: 7fd93b3139cc209931a77c59b86e3f60fba1c3bd
|
4
|
+
data.tar.gz: dd32125f60d347ec5324c92e166aab8113bc1347
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 37db0ccf9dfa838d3916ad51ec083d29287fd0d0bb4266816eea69c22bb29aeef024110b41ceb51c64b359e7875f1704e3152bb070b62e74400187a31cbf7825
|
7
|
+
data.tar.gz: df872aadbcabc726701758e231b394b4e0f057182ce86c31b340e62446a4109c95ebe9738ca43adc792bd9a7120b904fe63c2d74caddca6a5b0a1a287c9889c9
|
data/README.md
CHANGED
@@ -73,14 +73,15 @@ Once you have finished giving your Zombie all the strings it needs, tell it to g
|
|
73
73
|
array = zombie.generate_articles
|
74
74
|
|
75
75
|
File.open("articles.md", "w+") do |f|
|
76
|
-
array.each { |article| f.puts("#{article}
|
76
|
+
array.each { |article| f.puts("#{article}\n\n- - -\n") }
|
77
77
|
end
|
78
78
|
```
|
79
79
|
|
80
80
|
Here's an example article that might be generated by Zombie:
|
81
81
|
|
82
82
|
```markdown
|
83
|
-
|
83
|
+
## 0 - Lorem ipsum dolor sit amet.
|
84
|
+
|
84
85
|
Lorem ipsum dolor sit amet.---[Cicero's Great Speech On Ethics](http://example.com/lorem-ipsum)
|
85
86
|
|
86
87
|
Bacon ipsum dolor amet.---[Bacon Ipsum](http://baconipsum.com/)
|
@@ -88,10 +89,11 @@ Bacon ipsum dolor amet.---[Bacon Ipsum](http://baconipsum.com/)
|
|
88
89
|
Leverage agile frameworks.---[Corporate Ipsum](http://www.cipsum.com/)
|
89
90
|
|
90
91
|
Pork belly seitan photo booth.---[Hipster Ipsum](https://hipsum.co/)
|
91
|
-
|
92
|
+
|
93
|
+
- - -
|
92
94
|
```
|
93
95
|
|
94
|
-
###Citation
|
96
|
+
### Citation
|
95
97
|
You do not need to provide sourcetext or sourceurl. If you exclude the sourceurl, the article will only display the sourcetext as citation (with no hyperlink).
|
96
98
|
|
97
99
|
```ruby
|
@@ -123,9 +125,9 @@ zombie.add_string(content: "This is filler text that I invented.")
|
|
123
125
|
This is filler text that I invented.
|
124
126
|
```
|
125
127
|
|
126
|
-
##Real-World Examples
|
128
|
+
## Real-World Examples
|
127
129
|
|
128
|
-
###NaNoGenMo articles
|
130
|
+
### NaNoGenMo articles
|
129
131
|
The "National Novel Generation Month" competition has generated a lot of commentary on the Internet. Rather than hand-writing out new commentary, why not reuse existing ones?
|
130
132
|
|
131
133
|
- [Articles generated using ZombieWriter::MachineLearning](https://gist.github.com/tra38/aa7e9c63708f6e21c32db5c3616162b5)
|
data/lib/zombie_writer.rb
CHANGED
@@ -17,6 +17,15 @@ module ZombieWriter
|
|
17
17
|
end
|
18
18
|
end
|
19
19
|
|
20
|
+
def self.header(index, article_for_summarization)
|
21
|
+
generated_title = ClassifierReborn::Summarizer.summary(article_for_summarization, 1)
|
22
|
+
"## #{index} - #{generated_title}"
|
23
|
+
end
|
24
|
+
|
25
|
+
def self.formatted_article(header, final_article)
|
26
|
+
"#{header}\n\n#{final_article}\n"
|
27
|
+
end
|
28
|
+
|
20
29
|
class MachineLearning
|
21
30
|
attr_reader :lsi, :labels, :paragraph_data, :renderer, :plain_to_markdown
|
22
31
|
|
@@ -57,8 +66,8 @@ module ZombieWriter
|
|
57
66
|
"#{content}#{citation}"
|
58
67
|
end
|
59
68
|
|
60
|
-
|
61
|
-
|
69
|
+
header = ZombieWriter.header(cluster.id.to_s, article_for_summarization)
|
70
|
+
ZombieWriter.formatted_article(header, final_article)
|
62
71
|
end
|
63
72
|
end
|
64
73
|
|
@@ -114,8 +123,8 @@ module ZombieWriter
|
|
114
123
|
"#{content}#{citation}"
|
115
124
|
end
|
116
125
|
|
117
|
-
|
118
|
-
|
126
|
+
header = ZombieWriter.header(index, article_for_summarization)
|
127
|
+
ZombieWriter.formatted_article(header, final_article)
|
119
128
|
end
|
120
129
|
end
|
121
130
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zombie_writer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tariq Ali
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-03-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|