pcbr 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pcbr.rb +12 -7
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b127520de97919ba1fbce82430bef9f29c872dd8
|
4
|
+
data.tar.gz: 4b33ca2aa2c600ca3fe419815fae79b52bfa20ea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c5e44fb084dad37cfe1c29e4cd9607372dc255f7895731f5bec3e4cbb24574f01dfea035c96b43db2bcac937301597b7b39f16910b98ba85f1e31629a31180cc
|
7
|
+
data.tar.gz: 5339d942aac5fc793bb6311a0d75001f359dd11b1d6ca4f03f5b28944bbded74c8b57f0704f426decfc0386ebded944ee34424e509d6aeed27f3c89f0007cb6d
|
data/lib/pcbr.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
class PCBR
|
2
2
|
|
3
|
-
VERSION = "0.1.
|
3
|
+
VERSION = "0.1.2"
|
4
4
|
|
5
5
|
attr_reader :table
|
6
6
|
|
@@ -13,16 +13,21 @@ class PCBR
|
|
13
13
|
# @table.size
|
14
14
|
# end
|
15
15
|
|
16
|
+
ARRAY_101 = [0, 0, 0]
|
16
17
|
def store key, *vector
|
17
18
|
vector = vector.empty? ? [key] : vector.first
|
18
19
|
calculated = @callback[vector, key]
|
19
|
-
score =
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
20
|
+
score = 0
|
21
|
+
@table.each do |item|
|
22
|
+
array = ARRAY_101.dup
|
23
|
+
calculated.zip(item[3]).each do |a, b|
|
24
|
+
t = a <=> b
|
25
|
+
array[t] = t
|
24
26
|
end
|
25
|
-
|
27
|
+
point = array.inject :+
|
28
|
+
score += point
|
29
|
+
item[2] -= point
|
30
|
+
end
|
26
31
|
@table.push [key, vector, score, calculated]
|
27
32
|
end
|
28
33
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pcbr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Victor Maslov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-10-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -72,8 +72,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
72
72
|
version: '0'
|
73
73
|
requirements: []
|
74
74
|
rubyforge_project:
|
75
|
-
rubygems_version: 2.0.14
|
75
|
+
rubygems_version: 2.0.14
|
76
76
|
signing_key:
|
77
77
|
specification_version: 4
|
78
78
|
summary: Pair Comparison Based Rating
|
79
79
|
test_files: []
|
80
|
+
has_rdoc:
|