freq_stats 0.1.1

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.
@@ -0,0 +1,467 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>
7
+ Class: FreqStats::SuperArray
8
+
9
+ &mdash; Documentation by YARD 0.9.18
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
16
+
17
+ <script type="text/javascript" charset="utf-8">
18
+ pathId = "FreqStats::SuperArray";
19
+ relpath = '../';
20
+ </script>
21
+
22
+
23
+ <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
24
+
25
+ <script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
26
+
27
+
28
+ </head>
29
+ <body>
30
+ <div class="nav_wrap">
31
+ <iframe id="nav" src="../class_list.html?1"></iframe>
32
+ <div id="resizer"></div>
33
+ </div>
34
+
35
+ <div id="main" tabindex="-1">
36
+ <div id="header">
37
+ <div id="menu">
38
+
39
+ <a href="../_index.html">Index (S)</a> &raquo;
40
+ <span class='title'><span class='object_link'><a href="../FreqStats.html" title="FreqStats (module)">FreqStats</a></span></span>
41
+ &raquo;
42
+ <span class="title">SuperArray</span>
43
+
44
+ </div>
45
+
46
+ <div id="search">
47
+
48
+ <a class="full_list_link" id="class_list_link"
49
+ href="../class_list.html">
50
+
51
+ <svg width="24" height="24">
52
+ <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
53
+ <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
54
+ <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
55
+ </svg>
56
+ </a>
57
+
58
+ </div>
59
+ <div class="clear"></div>
60
+ </div>
61
+
62
+ <div id="content"><h1>Class: FreqStats::SuperArray
63
+
64
+
65
+
66
+ </h1>
67
+ <div class="box_info">
68
+
69
+ <dl>
70
+ <dt>Inherits:</dt>
71
+ <dd>
72
+ <span class="inheritName">SimpleDelegator</span>
73
+
74
+ <ul class="fullTree">
75
+ <li>Object</li>
76
+
77
+ <li class="next">SimpleDelegator</li>
78
+
79
+ <li class="next">FreqStats::SuperArray</li>
80
+
81
+ </ul>
82
+ <a href="#" class="inheritanceTree">show all</a>
83
+
84
+ </dd>
85
+ </dl>
86
+
87
+
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+
96
+
97
+ <dl>
98
+ <dt>Defined in:</dt>
99
+ <dd>lib/freq_stats/super_array.rb</dd>
100
+ </dl>
101
+
102
+ </div>
103
+
104
+ <h2>Overview</h2><div class="docstring">
105
+ <div class="discussion">
106
+
107
+ <p>creates a more powerful array using rubys simple delgator</p>
108
+
109
+
110
+ </div>
111
+ </div>
112
+ <div class="tags">
113
+
114
+
115
+ </div>
116
+
117
+
118
+
119
+
120
+
121
+
122
+
123
+ <h2>
124
+ Instance Method Summary
125
+ <small><a href="#" class="summary_toggle">collapse</a></small>
126
+ </h2>
127
+
128
+ <ul class="summary">
129
+
130
+ <li class="public ">
131
+ <span class="summary_signature">
132
+
133
+ <a href="#freq_list-instance_method" title="#freq_list (instance method)">#<strong>freq_list</strong> &#x21d2; Object </a>
134
+
135
+
136
+
137
+ </span>
138
+
139
+
140
+
141
+
142
+
143
+
144
+
145
+
146
+
147
+ <span class="summary_desc"><div class='inline'>
148
+ <p>freq_list An array of values and their popularity.</p>
149
+ </div></span>
150
+
151
+ </li>
152
+
153
+
154
+ <li class="public ">
155
+ <span class="summary_signature">
156
+
157
+ <a href="#mode-instance_method" title="#mode (instance method)">#<strong>mode</strong> &#x21d2; Object </a>
158
+
159
+
160
+
161
+ </span>
162
+
163
+
164
+
165
+
166
+
167
+
168
+
169
+
170
+
171
+ <span class="summary_desc"><div class='inline'>
172
+ <p>mode creates an hash ordered by most frequent element in the array.</p>
173
+ </div></span>
174
+
175
+ </li>
176
+
177
+
178
+ <li class="public ">
179
+ <span class="summary_signature">
180
+
181
+ <a href="#top_3-instance_method" title="#top_3 (instance method)">#<strong>top_3</strong> &#x21d2; Object </a>
182
+
183
+
184
+
185
+ </span>
186
+
187
+
188
+
189
+
190
+
191
+
192
+
193
+
194
+
195
+ <span class="summary_desc"><div class='inline'>
196
+ <p>top_3 sorts by the most frequest items and returns the top 3 most popular
197
+ ones.</p>
198
+ </div></span>
199
+
200
+ </li>
201
+
202
+
203
+ </ul>
204
+
205
+
206
+
207
+
208
+
209
+ <div id="instance_method_details" class="method_details_list">
210
+ <h2>Instance Method Details</h2>
211
+
212
+
213
+ <div class="method_details first">
214
+ <h3 class="signature first" id="freq_list-instance_method">
215
+
216
+ #<strong>freq_list</strong> &#x21d2; <tt>Object</tt>
217
+
218
+
219
+
220
+
221
+
222
+ </h3><div class="docstring">
223
+ <div class="discussion">
224
+
225
+ <p>freq_list An array of values and their popularity</p>
226
+
227
+
228
+ </div>
229
+ </div>
230
+ <div class="tags">
231
+
232
+ <p class="tag_title">Returns:</p>
233
+ <ul class="return">
234
+
235
+ <li>
236
+
237
+
238
+ <span class='type'></span>
239
+
240
+
241
+
242
+
243
+ <div class='inline'>
244
+ <p>Array of Arrays as [String, Int]</p>
245
+ </div>
246
+
247
+ </li>
248
+
249
+ </ul>
250
+ <p class="tag_title">Author:</p>
251
+ <ul class="author">
252
+
253
+ <li>
254
+
255
+
256
+
257
+
258
+
259
+ <div class='inline'>
260
+ <p>David J. Davis</p>
261
+ </div>
262
+
263
+ </li>
264
+
265
+ </ul>
266
+ <p class="tag_title">Since:</p>
267
+ <ul class="since">
268
+
269
+ <li>
270
+
271
+
272
+
273
+
274
+
275
+ <div class='inline'>
276
+ <p>0.1.0</p>
277
+ </div>
278
+
279
+ </li>
280
+
281
+ </ul>
282
+
283
+ </div><table class="source_code">
284
+ <tr>
285
+ <td>
286
+ <pre class="lines">
287
+
288
+
289
+ 30
290
+ 31
291
+ 32
292
+ 33</pre>
293
+ </td>
294
+ <td>
295
+ <pre class="code"><span class="info file"># File 'lib/freq_stats/super_array.rb', line 30</span>
296
+
297
+ <span class='kw'>def</span> <span class='id identifier rubyid_freq_list'>freq_list</span>
298
+ <span class='id identifier rubyid_freq_hash'>freq_hash</span> <span class='op'>=</span> <span class='id identifier rubyid_each_with_object'>each_with_object</span><span class='lparen'>(</span><span class='const'>Hash</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='int'>0</span><span class='rparen'>)</span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_v'>v</span><span class='comma'>,</span> <span class='id identifier rubyid_h'>h</span><span class='op'>|</span> <span class='id identifier rubyid_h'>h</span><span class='lbracket'>[</span><span class='id identifier rubyid_v'>v</span><span class='rbracket'>]</span> <span class='op'>+=</span> <span class='int'>1</span> <span class='rbrace'>}</span>
299
+ <span class='id identifier rubyid_freq_hash'>freq_hash</span><span class='period'>.</span><span class='id identifier rubyid_sort_by'>sort_by</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_k'>k</span><span class='comma'>,</span> <span class='id identifier rubyid_v'>v</span><span class='op'>|</span> <span class='op'>-</span><span class='id identifier rubyid_v'>v</span> <span class='rbrace'>}</span>
300
+ <span class='kw'>end</span></pre>
301
+ </td>
302
+ </tr>
303
+ </table>
304
+ </div>
305
+
306
+ <div class="method_details ">
307
+ <h3 class="signature " id="mode-instance_method">
308
+
309
+ #<strong>mode</strong> &#x21d2; <tt>Object</tt>
310
+
311
+
312
+
313
+
314
+
315
+ </h3><div class="docstring">
316
+ <div class="discussion">
317
+
318
+ <p>mode creates an hash ordered by most frequent element in the array</p>
319
+
320
+
321
+ </div>
322
+ </div>
323
+ <div class="tags">
324
+
325
+ <p class="tag_title">Author:</p>
326
+ <ul class="author">
327
+
328
+ <li>
329
+
330
+
331
+
332
+
333
+
334
+ <div class='inline'>
335
+ <p>David J. Davis</p>
336
+ </div>
337
+
338
+ </li>
339
+
340
+ </ul>
341
+ <p class="tag_title">Since:</p>
342
+ <ul class="since">
343
+
344
+ <li>
345
+
346
+
347
+
348
+
349
+
350
+ <div class='inline'>
351
+ <p>0.1.0</p>
352
+ </div>
353
+
354
+ </li>
355
+
356
+ </ul>
357
+
358
+ </div><table class="source_code">
359
+ <tr>
360
+ <td>
361
+ <pre class="lines">
362
+
363
+
364
+ 11
365
+ 12
366
+ 13</pre>
367
+ </td>
368
+ <td>
369
+ <pre class="code"><span class="info file"># File 'lib/freq_stats/super_array.rb', line 11</span>
370
+
371
+ <span class='kw'>def</span> <span class='id identifier rubyid_mode'>mode</span>
372
+ <span class='id identifier rubyid_each_with_object'>each_with_object</span><span class='lparen'>(</span><span class='const'>Hash</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='int'>0</span><span class='rparen'>)</span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_v'>v</span><span class='comma'>,</span> <span class='id identifier rubyid_h'>h</span><span class='op'>|</span> <span class='id identifier rubyid_h'>h</span><span class='lbracket'>[</span><span class='id identifier rubyid_v'>v</span><span class='rbracket'>]</span> <span class='op'>+=</span> <span class='int'>1</span> <span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_max_by'>max_by</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='symbol'>:last</span><span class='rparen'>)</span>
373
+ <span class='kw'>end</span></pre>
374
+ </td>
375
+ </tr>
376
+ </table>
377
+ </div>
378
+
379
+ <div class="method_details ">
380
+ <h3 class="signature " id="top_3-instance_method">
381
+
382
+ #<strong>top_3</strong> &#x21d2; <tt>Object</tt>
383
+
384
+
385
+
386
+
387
+
388
+ </h3><div class="docstring">
389
+ <div class="discussion">
390
+
391
+ <p>top_3 sorts by the most frequest items and returns the top 3 most popular
392
+ ones</p>
393
+
394
+
395
+ </div>
396
+ </div>
397
+ <div class="tags">
398
+
399
+ <p class="tag_title">Author:</p>
400
+ <ul class="author">
401
+
402
+ <li>
403
+
404
+
405
+
406
+
407
+
408
+ <div class='inline'>
409
+ <p>David J. Davis</p>
410
+ </div>
411
+
412
+ </li>
413
+
414
+ </ul>
415
+ <p class="tag_title">Since:</p>
416
+ <ul class="since">
417
+
418
+ <li>
419
+
420
+
421
+
422
+
423
+
424
+ <div class='inline'>
425
+ <p>0.1.0</p>
426
+ </div>
427
+
428
+ </li>
429
+
430
+ </ul>
431
+
432
+ </div><table class="source_code">
433
+ <tr>
434
+ <td>
435
+ <pre class="lines">
436
+
437
+
438
+ 20
439
+ 21
440
+ 22
441
+ 23</pre>
442
+ </td>
443
+ <td>
444
+ <pre class="code"><span class="info file"># File 'lib/freq_stats/super_array.rb', line 20</span>
445
+
446
+ <span class='kw'>def</span> <span class='id identifier rubyid_top_3'>top_3</span>
447
+ <span class='id identifier rubyid_freq_hash'>freq_hash</span> <span class='op'>=</span> <span class='id identifier rubyid_each_with_object'>each_with_object</span><span class='lparen'>(</span><span class='const'>Hash</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='int'>0</span><span class='rparen'>)</span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_v'>v</span><span class='comma'>,</span> <span class='id identifier rubyid_h'>h</span><span class='op'>|</span> <span class='id identifier rubyid_h'>h</span><span class='lbracket'>[</span><span class='id identifier rubyid_v'>v</span><span class='rbracket'>]</span> <span class='op'>+=</span> <span class='int'>1</span> <span class='rbrace'>}</span>
448
+ <span class='id identifier rubyid_freq_hash'>freq_hash</span><span class='period'>.</span><span class='id identifier rubyid_sort_by'>sort_by</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_k'>k</span><span class='comma'>,</span> <span class='id identifier rubyid_v'>v</span><span class='op'>|</span> <span class='op'>-</span><span class='id identifier rubyid_v'>v</span> <span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span><span class='lparen'>(</span><span class='int'>3</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='symbol'>:first</span><span class='rparen'>)</span>
449
+ <span class='kw'>end</span></pre>
450
+ </td>
451
+ </tr>
452
+ </table>
453
+ </div>
454
+
455
+ </div>
456
+
457
+ </div>
458
+
459
+ <div id="footer">
460
+ Generated on Thu Jan 31 18:30:05 2019 by
461
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
462
+ 0.9.18 (ruby-2.5.3).
463
+ </div>
464
+
465
+ </div>
466
+ </body>
467
+ </html>
@@ -0,0 +1,155 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>
7
+ Module: FreqStats
8
+
9
+ &mdash; Documentation by YARD 0.9.18
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="css/common.css" type="text/css" charset="utf-8" />
16
+
17
+ <script type="text/javascript" charset="utf-8">
18
+ pathId = "FreqStats";
19
+ relpath = '';
20
+ </script>
21
+
22
+
23
+ <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
24
+
25
+ <script type="text/javascript" charset="utf-8" src="js/app.js"></script>
26
+
27
+
28
+ </head>
29
+ <body>
30
+ <div class="nav_wrap">
31
+ <iframe id="nav" src="class_list.html?1"></iframe>
32
+ <div id="resizer"></div>
33
+ </div>
34
+
35
+ <div id="main" tabindex="-1">
36
+ <div id="header">
37
+ <div id="menu">
38
+
39
+ <a href="_index.html">Index (F)</a> &raquo;
40
+
41
+
42
+ <span class="title">FreqStats</span>
43
+
44
+ </div>
45
+
46
+ <div id="search">
47
+
48
+ <a class="full_list_link" id="class_list_link"
49
+ href="class_list.html">
50
+
51
+ <svg width="24" height="24">
52
+ <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
53
+ <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
54
+ <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
55
+ </svg>
56
+ </a>
57
+
58
+ </div>
59
+ <div class="clear"></div>
60
+ </div>
61
+
62
+ <div id="content"><h1>Module: FreqStats
63
+
64
+
65
+
66
+ </h1>
67
+ <div class="box_info">
68
+
69
+
70
+
71
+
72
+
73
+
74
+
75
+
76
+
77
+
78
+
79
+ <dl>
80
+ <dt>Defined in:</dt>
81
+ <dd>lib/freq_stats/super_array.rb<span class="defines">,<br />
82
+ lib/freq_stats/version.rb</span>
83
+ </dd>
84
+ </dl>
85
+
86
+ </div>
87
+
88
+ <h2>Overview</h2><div class="docstring">
89
+ <div class="discussion">
90
+
91
+ <p>Freq Stats Module Made as a module to create an extendible base</p>
92
+
93
+
94
+ </div>
95
+ </div>
96
+ <div class="tags">
97
+
98
+
99
+ </div><h2>Defined Under Namespace</h2>
100
+ <p class="children">
101
+
102
+
103
+
104
+
105
+ <strong class="classes">Classes:</strong> <span class='object_link'><a href="FreqStats/SuperArray.html" title="FreqStats::SuperArray (class)">SuperArray</a></span>
106
+
107
+
108
+ </p>
109
+
110
+
111
+ <h2>
112
+ Constant Summary
113
+ <small><a href="#" class="constants_summary_toggle">collapse</a></small>
114
+ </h2>
115
+
116
+ <dl class="constants">
117
+
118
+ <dt id="VERSION-constant" class="">VERSION =
119
+ <div class="docstring">
120
+ <div class="discussion">
121
+
122
+ <p>current version number</p>
123
+
124
+
125
+ </div>
126
+ </div>
127
+ <div class="tags">
128
+
129
+
130
+ </div>
131
+ </dt>
132
+ <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>0.1.0</span><span class='tstring_end'>&quot;</span></span></pre></dd>
133
+
134
+ </dl>
135
+
136
+
137
+
138
+
139
+
140
+
141
+
142
+
143
+
144
+
145
+ </div>
146
+
147
+ <div id="footer">
148
+ Generated on Thu Jan 31 18:30:05 2019 by
149
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
150
+ 0.9.18 (ruby-2.5.3).
151
+ </div>
152
+
153
+ </div>
154
+ </body>
155
+ </html>