artemo 3.1.6 → 3.1.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (69) hide show
  1. checksums.yaml +4 -4
  2. data/.DS_Store +0 -0
  3. data/CHANGELOG +3 -0
  4. data/Gemfile.lock +1 -1
  5. data/README.md +9 -2
  6. data/artemo.gemspec +2 -0
  7. data/examples/{result/A Sketch For A Modern Love Poem - Poem by Tadeusz Rozewicz.pdf → A Sketch For A Modern Love Poem - Poem by Tadeusz Rozewicz.pdf} +0 -0
  8. data/examples/{txt/A Sketch For A Modern Love Poem - Poem by Tadeusz Rozewicz.txt → A Sketch For A Modern Love Poem - Poem by Tadeusz Rozewicz.txt} +0 -0
  9. data/examples/{result/Earth Again - Poem by Czeslaw Milosz.pdf → Earth Again - Poem by Czeslaw Milosz.pdf } +126 -60
  10. data/examples/{txt/Earth Again - Poem by Czeslaw Milosz.txt → Earth Again - Poem by Czeslaw Milosz.txt} +0 -0
  11. data/examples/{result/First Love - Poem by Wislawa Szymborska.pdf → First Love - Poem by Wislawa Szymborska.pdf } +12 -12
  12. data/examples/{txt/First Love - Poem by Wislawa Szymborska.txt → First Love - Poem by Wislawa Szymborska.txt} +0 -0
  13. data/examples/{result/Polish Flowers - Poem by Julian Tuwim.pdf → Grass - Poem by Julian Tuwim.pdf } +12 -12
  14. data/examples/{txt/Grass - Poem by Julian Tuwim.txt → Grass - Poem by Julian Tuwim.txt} +0 -0
  15. data/examples/{result/Rovigo - Poem by Zbigniew Herbert.pdf → Hatred - Poem by Wislawa Szymborska.pdf } +17 -17
  16. data/examples/{txt/Hatred - Poem by Wislawa Szymborska.txt → Hatred - Poem by Wislawa Szymborska.txt} +0 -0
  17. data/examples/{result/It Was Winter - Poem by Czeslaw Milosz.pdf → It Was Winter - Poem by Czeslaw Milosz.pdf } +17 -17
  18. data/examples/{txt/It Was Winter - Poem by Czeslaw Milosz.txt → It Was Winter - Poem by Czeslaw Milosz.txt} +0 -0
  19. data/examples/{result/Photograph From September 11 - Poem by Wislawa Szymborska.pdf → Photograph From September 11 - Poem by Wislawa Szymborska.pdf} +0 -0
  20. data/examples/{txt/Photograph From September 11 - Poem by Wislawa Szymborska.txt → Photograph From September 11 - Poem by Wislawa Szymborska.txt} +0 -0
  21. data/examples/{result/Pigtail - Poem by Tadeusz Rozewicz.pdf → Pigtail - Poem by Tadeusz Rozewicz.pdf} +0 -0
  22. data/examples/{txt/Pigtail - Poem by Tadeusz Rozewicz.txt → Pigtail - Poem by Tadeusz Rozewicz.txt} +0 -0
  23. data/examples/{txt/Polish Flowers - Poem by Julian Tuwim.txt → Polish Flowers - Poem by Julian Tuwim.txt} +0 -0
  24. data/examples/{result/Preface - Poem by Czeslaw Milosz.pdf → Preface - Poem by Czeslaw Milosz.pdf } +12 -12
  25. data/examples/{txt/Preface - Poem by Czeslaw Milosz.txt → Preface - Poem by Czeslaw Milosz.txt} +0 -0
  26. data/examples/{result/Grass - Poem by Julian Tuwim.pdf → Rovigo - Poem by Zbigniew Herbert.pdf } +25 -25
  27. data/examples/{txt/Rovigo - Poem by Zbigniew Herbert.txt → Rovigo - Poem by Zbigniew Herbert.txt} +0 -0
  28. data/examples/{result/The Dancing Socrates - Poem by Julian Tuwim.pdf → The Dancing Socrates - Poem by Julian Tuwim.pdf } +12 -12
  29. data/examples/{txt/The Dancing Socrates - Poem by Julian Tuwim.txt → The Dancing Socrates - Poem by Julian Tuwim.txt} +0 -0
  30. data/examples/{result/The Fable About A Nail - Poem by Zbigniew Herbert.pdf → The Fable About A Nail - Poem by Zbigniew Herbert.pdf } +14 -14
  31. data/examples/{txt/The Fable About A Nail - Poem by Zbigniew Herbert.txt → The Fable About A Nail - Poem by Zbigniew Herbert.txt} +0 -0
  32. data/examples/{result/The Gate - Poem by Tadeusz Rozewicz.pdf → The Gate - Poem by Tadeusz Rozewicz.pdf } +26 -26
  33. data/examples/{txt/The Gate - Poem by Tadeusz Rozewicz.txt → The Gate - Poem by Tadeusz Rozewicz.txt} +0 -0
  34. data/examples/{result/The Return - Poem by Tadeusz Rozewicz.pdf → The Return - Poem by Tadeusz Rozewicz.pdf } +20 -20
  35. data/examples/{txt/The Return - Poem by Tadeusz Rozewicz.txt → The Return - Poem by Tadeusz Rozewicz.txt} +0 -0
  36. data/examples/The Road - Poem by Czeslaw Milosz.pdf +209 -0
  37. data/examples/{txt/The Road - Poem by Czeslaw Milosz.txt → The Road - Poem by Czeslaw Milosz.txt} +0 -0
  38. data/examples/{result/The Saturday Night Song - Poem by Julian Tuwim.pdf → The Saturday Night Song - Poem by Julian Tuwim.pdf } +37 -37
  39. data/examples/{txt/The Saturday Night Song - Poem by Julian Tuwim.txt → The Saturday Night Song - Poem by Julian Tuwim.txt} +0 -0
  40. data/examples/{result/The Survivor - Poem by Tadeusz Rozewicz.pdf → The Survivor - Poem by Tadeusz Rozewicz.pdf} +0 -0
  41. data/examples/{txt/The Survivor - Poem by Tadeusz Rozewicz.txt → The Survivor - Poem by Tadeusz Rozewicz.txt} +0 -0
  42. data/examples/{result/To My Bones - Poem by Zbigniew Herbert.pdf → To My Bones - Poem by Zbigniew Herbert.pdf} +0 -0
  43. data/examples/{txt/To My Bones - Poem by Zbigniew Herbert.txt → To My Bones - Poem by Zbigniew Herbert.txt} +0 -0
  44. data/examples/Two Monkeys by Brueghel - Poem by Wislawa Szymborska.pdf +242 -0
  45. data/examples/{txt/Two Monkeys by Brueghel - Poem by Wislawa Szymborska.txt → Two Monkeys by Brueghel - Poem by Wislawa Szymborska.txt} +0 -0
  46. data/examples/{result/Veni Seer - Poem by Czeslaw Milosz.pdf → Veni Seer - Poem by Czeslaw Milosz.pdf} +0 -0
  47. data/examples/{txt/Veni Seer - Poem by Czeslaw Milosz.txt → Veni Seer - Poem by Czeslaw Milosz.txt} +0 -0
  48. data/examples/{result/Vermeer - Poem by Wislawa Szymborska.pdf → Vermeer - Poem by Wislawa Szymborska.pdf} +0 -0
  49. data/examples/{txt/Vermeer - Poem by Wislawa Szymborska.txt → Vermeer - Poem by Wislawa Szymborska.txt} +0 -0
  50. data/examples/{result/Wasp - Poem by Zbigniew Herbert.pdf → Wasp - Poem by Zbigniew Herbert.pdf } +17 -17
  51. data/examples/{txt/Wasp - Poem by Zbigniew Herbert.txt → Wasp - Poem by Zbigniew Herbert.txt} +0 -0
  52. data/examples/{result/What Our Dead Do - Poem by Zbigniew Herbert.pdf → What Our Dead Do - Poem by Zbigniew Herbert.pdf } +14 -14
  53. data/examples/{txt/What Our Dead Do - Poem by Zbigniew Herbert.txt → What Our Dead Do - Poem by Zbigniew Herbert.txt} +0 -0
  54. data/examples/{result/Wife - Poem by Julian Tuwim.pdf → Wife - Poem by Julian Tuwim.pdf } +12 -12
  55. data/examples/{txt/Wife - Poem by Julian Tuwim.txt → Wife - Poem by Julian Tuwim.txt} +0 -0
  56. data/lib/.DS_Store +0 -0
  57. data/lib/artemo/common.rb +4 -3
  58. data/lib/artemo/plot.rb +3 -3
  59. data/lib/artemo/result.rb +1 -1
  60. data/lib/artemo/version.rb +1 -1
  61. data/lib/artemo.rb +4 -1
  62. data/spec/.DS_Store +0 -0
  63. data/spec/test_artemo_common_spec.rb +2 -2
  64. data/spec/test_artemo_result_spec.rb +2 -2
  65. metadata +54 -55
  66. data/examples/result/Hatred - Poem by Wislawa Szymborska.pdf +0 -374
  67. data/examples/result/The Road - Poem by Czeslaw Milosz.pdf +0 -275
  68. data/examples/result/Two Monkeys by Brueghel - Poem by Wislawa Szymborska.pdf +0 -341
  69. data/spec/test_artemo_basic_emotions_spec.rb +0 -10
@@ -0,0 +1,242 @@
1
+ %PDF-1.4
2
+ %����
3
+ 1 0 obj
4
+ << /Creator <feff0050007200610077006e>
5
+ /Producer <feff0050007200610077006e>
6
+ >>
7
+ endobj
8
+ 2 0 obj
9
+ << /Type /Catalog
10
+ /Pages 3 0 R
11
+ >>
12
+ endobj
13
+ 3 0 obj
14
+ << /Type /Pages
15
+ /Count 1
16
+ /Kids [5 0 R]
17
+ >>
18
+ endobj
19
+ 4 0 obj
20
+ << /Length 1247
21
+ >>
22
+ stream
23
+ q
24
+ 0.5 w
25
+ q
26
+ /Tr1 gs
27
+ 69.0 741.0 m
28
+ 576.0 741.0 l
29
+ S
30
+ S
31
+ Q
32
+ 1 w
33
+ 0.5 w
34
+ q
35
+ /Tr1 gs
36
+ 69.0 687.25 m
37
+ 576.0 687.25 l
38
+ S
39
+ S
40
+ Q
41
+ 1 w
42
+ 0.5 w
43
+ q
44
+ /Tr1 gs
45
+ 69.0 633.5 m
46
+ 576.0 633.5 l
47
+ S
48
+ S
49
+ Q
50
+ 1 w
51
+ 0.5 w
52
+ q
53
+ /Tr1 gs
54
+ 69.0 579.75 m
55
+ 576.0 579.75 l
56
+ S
57
+ S
58
+ Q
59
+ 1 w
60
+
61
+ BT
62
+ 36.872 738.128 Td
63
+ /F1.0 8 Tf
64
+ [<3130302e3025>] TJ
65
+ ET
66
+
67
+
68
+ BT
69
+ 41.32 684.378 Td
70
+ /F1.0 8 Tf
71
+ [<37352e3025>] TJ
72
+ ET
73
+
74
+
75
+ BT
76
+ 41.32 630.628 Td
77
+ /F1.0 8 Tf
78
+ [<35302e3025>] TJ
79
+ ET
80
+
81
+
82
+ BT
83
+ 41.32 576.878 Td
84
+ /F1.0 8 Tf
85
+ [<32352e3025>] TJ
86
+ ET
87
+
88
+
89
+ BT
90
+ 45.768 523.128 Td
91
+ /F1.0 8 Tf
92
+ [<302e3025>] TJ
93
+ ET
94
+
95
+ /DeviceRGB cs
96
+ 0.180 0.341 0.549 scn
97
+ /DeviceRGB CS
98
+ 0.180 0.341 0.549 SCN
99
+ q
100
+ /Tr2 gs
101
+ 100.6875 526.0 190.125 215.0 re
102
+ f
103
+ S
104
+ Q
105
+ 0.000 0.000 0.000 scn
106
+ 0.000 0.000 0.000 SCN
107
+ 0.180 0.341 0.549 scn
108
+ q
109
+ /Tr3 gs
110
+
111
+ BT
112
+ 178.795 747.07 Td
113
+ /F2.0 10 Tf
114
+ [<3130302e3025>] TJ
115
+ ET
116
+
117
+ S
118
+ Q
119
+ 0.000 0.000 0.000 scn
120
+ 0.180 0.341 0.549 scn
121
+ 0.180 0.341 0.549 SCN
122
+ q
123
+ /Tr2 gs
124
+ 354.1875 526.0 190.125 215.0 re
125
+ f
126
+ S
127
+ Q
128
+ 0.000 0.000 0.000 scn
129
+ 0.000 0.000 0.000 SCN
130
+ 0.180 0.341 0.549 scn
131
+ q
132
+ /Tr3 gs
133
+
134
+ BT
135
+ 432.295 747.07 Td
136
+ /F2.0 10 Tf
137
+ [<3130302e3025>] TJ
138
+ ET
139
+
140
+ S
141
+ Q
142
+ 0.000 0.000 0.000 scn
143
+
144
+ BT
145
+ 182.634 513.128 Td
146
+ /F1.0 8 Tf
147
+ [<64657370616972>] TJ
148
+ ET
149
+
150
+ 195.75 526.0 m
151
+ 195.75 524.0 l
152
+ S
153
+
154
+ BT
155
+ 437.246 513.128 Td
156
+ /F1.0 8 Tf
157
+ [<7368616d65>] TJ
158
+ ET
159
+
160
+ 449.25 526.0 m
161
+ 449.25 524.0 l
162
+ S
163
+ q
164
+ /Tr3 gs
165
+ 69.0 526.0 m
166
+ 576.0 526.0 l
167
+ S
168
+ S
169
+ Q
170
+ Q
171
+
172
+ endstream
173
+ endobj
174
+ 5 0 obj
175
+ << /Type /Page
176
+ /Parent 3 0 R
177
+ /MediaBox [0 0 612.0 792.0]
178
+ /Contents 4 0 R
179
+ /Resources << /ProcSet [/PDF /Text /ImageB /ImageC /ImageI]
180
+ /Font << /F1.0 7 0 R
181
+ /F2.0 10 0 R
182
+ >>
183
+ /ExtGState << /Tr1 6 0 R
184
+ /Tr2 8 0 R
185
+ /Tr3 9 0 R
186
+ >>
187
+ >>
188
+ >>
189
+ endobj
190
+ 6 0 obj
191
+ << /Type /ExtGState
192
+ /CA 0.25
193
+ /ca 0.25
194
+ >>
195
+ endobj
196
+ 7 0 obj
197
+ << /Type /Font
198
+ /Subtype /Type1
199
+ /BaseFont /Helvetica
200
+ /Encoding /WinAnsiEncoding
201
+ >>
202
+ endobj
203
+ 8 0 obj
204
+ << /Type /ExtGState
205
+ /CA 0.95
206
+ /ca 0.95
207
+ >>
208
+ endobj
209
+ 9 0 obj
210
+ << /Type /ExtGState
211
+ /CA 1.0
212
+ /ca 1.0
213
+ >>
214
+ endobj
215
+ 10 0 obj
216
+ << /Type /Font
217
+ /Subtype /Type1
218
+ /BaseFont /Helvetica-Bold
219
+ /Encoding /WinAnsiEncoding
220
+ >>
221
+ endobj
222
+ xref
223
+ 0 11
224
+ 0000000000 65535 f
225
+ 0000000015 00000 n
226
+ 0000000109 00000 n
227
+ 0000000158 00000 n
228
+ 0000000215 00000 n
229
+ 0000001514 00000 n
230
+ 0000001755 00000 n
231
+ 0000001811 00000 n
232
+ 0000001908 00000 n
233
+ 0000001964 00000 n
234
+ 0000002018 00000 n
235
+ trailer
236
+ << /Size 11
237
+ /Root 2 0 R
238
+ /Info 1 0 R
239
+ >>
240
+ startxref
241
+ 2121
242
+ %%EOF
@@ -17,7 +17,7 @@ endobj
17
17
  >>
18
18
  endobj
19
19
  4 0 obj
20
- << /Length 2620
20
+ << /Length 2618
21
21
  >>
22
22
  stream
23
23
  q
@@ -98,7 +98,7 @@ ET
98
98
  0.180 0.341 0.549 SCN
99
99
  q
100
100
  /Tr2 gs
101
- 79.5625 526.0 63.375 49.45 re
101
+ 79.5625 526.0 63.375 51.6 re
102
102
  f
103
103
  S
104
104
  Q
@@ -109,9 +109,9 @@ q
109
109
  /Tr3 gs
110
110
 
111
111
  BT
112
- 97.075 581.52 Td
112
+ 97.075 583.67 Td
113
113
  /F2.0 10 Tf
114
- [<32332e3025>] TJ
114
+ [<32342e3025>] TJ
115
115
  ET
116
116
 
117
117
  S
@@ -121,7 +121,7 @@ Q
121
121
  0.180 0.341 0.549 SCN
122
122
  q
123
123
  /Tr2 gs
124
- 164.0625 526.0 63.375 49.45 re
124
+ 164.0625 526.0 63.375 51.6 re
125
125
  f
126
126
  S
127
127
  Q
@@ -132,9 +132,9 @@ q
132
132
  /Tr3 gs
133
133
 
134
134
  BT
135
- 181.575 581.52 Td
135
+ 181.575 583.67 Td
136
136
  /F2.0 10 Tf
137
- [<32332e3025>] TJ
137
+ [<32342e3025>] TJ
138
138
  ET
139
139
 
140
140
  S
@@ -144,7 +144,7 @@ Q
144
144
  0.180 0.341 0.549 SCN
145
145
  q
146
146
  /Tr2 gs
147
- 248.5625 526.0 63.375 96.75 re
147
+ 248.5625 526.0 63.375 103.2 re
148
148
  f
149
149
  S
150
150
  Q
@@ -155,9 +155,9 @@ q
155
155
  /Tr3 gs
156
156
 
157
157
  BT
158
- 266.075 628.82 Td
158
+ 266.075 635.27 Td
159
159
  /F2.0 10 Tf
160
- [<34352e3025>] TJ
160
+ [<34382e3025>] TJ
161
161
  ET
162
162
 
163
163
  S
@@ -358,17 +358,17 @@ xref
358
358
  0000000109 00000 n
359
359
  0000000158 00000 n
360
360
  0000000215 00000 n
361
- 0000002887 00000 n
362
- 0000003128 00000 n
363
- 0000003184 00000 n
364
- 0000003281 00000 n
365
- 0000003337 00000 n
366
- 0000003391 00000 n
361
+ 0000002885 00000 n
362
+ 0000003126 00000 n
363
+ 0000003182 00000 n
364
+ 0000003279 00000 n
365
+ 0000003335 00000 n
366
+ 0000003389 00000 n
367
367
  trailer
368
368
  << /Size 11
369
369
  /Root 2 0 R
370
370
  /Info 1 0 R
371
371
  >>
372
372
  startxref
373
- 3494
373
+ 3492
374
374
  %%EOF
@@ -17,7 +17,7 @@ endobj
17
17
  >>
18
18
  endobj
19
19
  4 0 obj
20
- << /Length 2285
20
+ << /Length 2284
21
21
  >>
22
22
  stream
23
23
  q
@@ -98,7 +98,7 @@ ET
98
98
  0.180 0.341 0.549 SCN
99
99
  q
100
100
  /Tr2 gs
101
- 81.675 526.0 76.05 27.95 re
101
+ 81.675 526.0 76.05 23.65 re
102
102
  f
103
103
  S
104
104
  Q
@@ -109,9 +109,9 @@ q
109
109
  /Tr3 gs
110
110
 
111
111
  BT
112
- 105.525 560.02 Td
112
+ 105.525 555.72 Td
113
113
  /F2.0 10 Tf
114
- [<31332e3025>] TJ
114
+ [<31312e3025>] TJ
115
115
  ET
116
116
 
117
117
  S
@@ -121,7 +121,7 @@ Q
121
121
  0.180 0.341 0.549 SCN
122
122
  q
123
123
  /Tr2 gs
124
- 183.075 526.0 76.05 53.75 re
124
+ 183.075 526.0 76.05 47.3 re
125
125
  f
126
126
  S
127
127
  Q
@@ -132,9 +132,9 @@ q
132
132
  /Tr3 gs
133
133
 
134
134
  BT
135
- 206.925 585.82 Td
135
+ 206.925 579.37 Td
136
136
  /F2.0 10 Tf
137
- [<32352e3025>] TJ
137
+ [<32322e3025>] TJ
138
138
  ET
139
139
 
140
140
  S
@@ -325,17 +325,17 @@ xref
325
325
  0000000109 00000 n
326
326
  0000000158 00000 n
327
327
  0000000215 00000 n
328
- 0000002552 00000 n
329
- 0000002793 00000 n
330
- 0000002849 00000 n
331
- 0000002946 00000 n
332
- 0000003002 00000 n
333
- 0000003056 00000 n
328
+ 0000002551 00000 n
329
+ 0000002792 00000 n
330
+ 0000002848 00000 n
331
+ 0000002945 00000 n
332
+ 0000003001 00000 n
333
+ 0000003055 00000 n
334
334
  trailer
335
335
  << /Size 11
336
336
  /Root 2 0 R
337
337
  /Info 1 0 R
338
338
  >>
339
339
  startxref
340
- 3159
340
+ 3158
341
341
  %%EOF
@@ -98,7 +98,7 @@ ET
98
98
  0.180 0.341 0.549 SCN
99
99
  q
100
100
  /Tr2 gs
101
- 79.5625 526.0 63.375 73.1 re
101
+ 79.5625 526.0 63.375 70.95 re
102
102
  f
103
103
  S
104
104
  Q
@@ -109,9 +109,9 @@ q
109
109
  /Tr3 gs
110
110
 
111
111
  BT
112
- 97.075 605.17 Td
112
+ 97.075 603.02 Td
113
113
  /F2.0 10 Tf
114
- [<33342e3025>] TJ
114
+ [<33332e3025>] TJ
115
115
  ET
116
116
 
117
117
  S
@@ -121,7 +121,7 @@ Q
121
121
  0.180 0.341 0.549 SCN
122
122
  q
123
123
  /Tr2 gs
124
- 164.0625 526.0 63.375 73.1 re
124
+ 164.0625 526.0 63.375 70.95 re
125
125
  f
126
126
  S
127
127
  Q
@@ -132,9 +132,9 @@ q
132
132
  /Tr3 gs
133
133
 
134
134
  BT
135
- 181.575 605.17 Td
135
+ 181.575 603.02 Td
136
136
  /F2.0 10 Tf
137
- [<33342e3025>] TJ
137
+ [<33332e3025>] TJ
138
138
  ET
139
139
 
140
140
  S
@@ -144,7 +144,7 @@ Q
144
144
  0.180 0.341 0.549 SCN
145
145
  q
146
146
  /Tr2 gs
147
- 248.5625 526.0 63.375 144.05 re
147
+ 248.5625 526.0 63.375 141.9 re
148
148
  f
149
149
  S
150
150
  Q
@@ -155,9 +155,9 @@ q
155
155
  /Tr3 gs
156
156
 
157
157
  BT
158
- 266.075 676.12 Td
158
+ 266.075 673.97 Td
159
159
  /F2.0 10 Tf
160
- [<36372e3025>] TJ
160
+ [<36362e3025>] TJ
161
161
  ET
162
162
 
163
163
  S
@@ -167,7 +167,7 @@ Q
167
167
  0.180 0.341 0.549 SCN
168
168
  q
169
169
  /Tr2 gs
170
- 333.0625 526.0 63.375 144.05 re
170
+ 333.0625 526.0 63.375 141.9 re
171
171
  f
172
172
  S
173
173
  Q
@@ -178,9 +178,9 @@ q
178
178
  /Tr3 gs
179
179
 
180
180
  BT
181
- 350.575 676.12 Td
181
+ 350.575 673.97 Td
182
182
  /F2.0 10 Tf
183
- [<36372e3025>] TJ
183
+ [<36362e3025>] TJ
184
184
  ET
185
185
 
186
186
  S
data/lib/.DS_Store CHANGED
Binary file
data/lib/artemo/common.rb CHANGED
@@ -2,12 +2,13 @@
2
2
  # @return [Array] of scaled emotions in range 0..100
3
3
  class Common
4
4
 
5
- # @note This method is scaling values in range 1..100
5
+ # @note This method is scaling values in range min..100
6
6
 
7
7
  def self.scale(array_one)
8
8
  min, max = array_one.minmax
9
- array_one.each.with_index do |item, index|
10
- array_one[index] = (((100.0 - 1.0) / (max - min)) * (item - max) + 100.0).floor
9
+ to_min = ((min.to_f / max.to_f) * 100.0).floor.to_f
10
+ array_one.each_index do |index|
11
+ array_one[index] = ((100.0 - to_min) * (array_one[index] - min).to_f / (max - min).to_f + to_min).to_i
11
12
  end
12
13
  array_one
13
14
  end
data/lib/artemo/plot.rb CHANGED
@@ -4,9 +4,10 @@ class Plot
4
4
 
5
5
  # @note This method is plotting data to pdf.
6
6
 
7
- def self.call(hash)
7
+ def self.call(path, hash)
8
8
  begin
9
- Prawn::Document.generate 'emotions.pdf' do
9
+ name = File.basename(path, '.txt')
10
+ Prawn::Document.generate "#{name}.pdf" do
10
11
  data = {views: hash}
11
12
  chart data, legend: false, label: true, format: :percentage
12
13
  end
@@ -15,4 +16,3 @@ class Plot
15
16
  end
16
17
  end
17
18
  end
18
-
data/lib/artemo/result.rb CHANGED
@@ -17,7 +17,7 @@ class Result < Common
17
17
  array_one.each_index do |index|
18
18
  results[titles[index]] = array_one[index]
19
19
  end
20
- results.delete_if{|_k, v| v == 1 || v == 2}
20
+ results.delete_if{|_k, v| v == 0}
21
21
  results.sort_by { |_k, v| v }.to_h
22
22
  end
23
23
 
@@ -1,4 +1,4 @@
1
1
  # @note This module returns version
2
2
  module ArtEmo
3
- VERSION = "3.1.6"
3
+ VERSION = "3.1.7"
4
4
  end
data/lib/artemo.rb CHANGED
@@ -14,6 +14,9 @@ require 'artemo/plot'
14
14
  # @note This class starts all program
15
15
  # @return [Hash] of complex emotions
16
16
  class ArtEmo
17
+
18
+ # @note This method starts all other methods in classes
19
+
17
20
  def self.call(text_file)
18
21
  keywords = Keywords.call
19
22
  text = Loader.call(text_file)
@@ -35,5 +38,5 @@ elsif ARGV.first != '--plot'
35
38
  puts ArtEmo.call(ARGV.last)
36
39
  else
37
40
  to_plot = ArtEmo.call(ARGV.last)
38
- Plot.call(to_plot)
41
+ Plot.call(ARGV.last, to_plot)
39
42
  end
data/spec/.DS_Store CHANGED
Binary file
@@ -3,8 +3,8 @@ require 'artemo'
3
3
  describe Common do
4
4
  context 'Common method ' do
5
5
  it 'scale' do
6
- s = Common.scale([500, 250, 100, 50, 25, 0, -75])
7
- expect(s).to eq [100, 56, 31, 22, 18, 13, 1]
6
+ s = Common.scale([500, 250, 100, 50, 25, 0, 15, 1])
7
+ expect(s).to eq [100, 50, 20, 10, 5, 0, 3, 0]
8
8
  end
9
9
  end
10
10
  end
@@ -17,8 +17,8 @@ describe Result do
17
17
  it 'min, max' do
18
18
  s = Result.call([100, 30, 30, 30, 30, 30, 30, 5, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 700, 30])
19
19
  min, max = s.values.minmax
20
- expect(min).to eq 4.0
21
- expect(max).to eq 100.0
20
+ expect(min).to eq 3
21
+ expect(max).to eq 100
22
22
  end
23
23
  end
24
24
  end