frequency_analyser 1.2.3 → 1.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.
- data/lib/frequency_analyser/aggregator.rb +4 -3
- metadata +3 -3
@@ -1,6 +1,6 @@
|
|
1
1
|
class FrequencyAnalyser::Aggregator < Struct.new(:counter, :aggregation)
|
2
2
|
|
3
|
-
def initialize(counter = fa::Counter, aggregation = fa::Aggregation
|
3
|
+
def initialize(counter = fa::Counter, aggregation = fa::Aggregation)
|
4
4
|
super
|
5
5
|
end
|
6
6
|
|
@@ -9,14 +9,15 @@ class FrequencyAnalyser::Aggregator < Struct.new(:counter, :aggregation)
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def aggregate(*files)
|
12
|
+
hash = aggregation.new
|
12
13
|
files = coerce(files)
|
13
14
|
files.each do |file|
|
14
15
|
file.each_line do |line|
|
15
|
-
|
16
|
+
hash << counter.count(line)
|
16
17
|
end
|
17
18
|
reset(file)
|
18
19
|
end
|
19
|
-
|
20
|
+
hash
|
20
21
|
end
|
21
22
|
|
22
23
|
private
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: frequency_analyser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 23
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 1.2.
|
9
|
+
- 4
|
10
|
+
version: 1.2.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Christopher Patuzzo
|