google_perspective 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/google_perspective/comment_analizer.rb +6 -2
- data/lib/google_perspective/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e2f4e277e8bae164defd4336f6a2e584975ee7b2
|
4
|
+
data.tar.gz: 436cdcb75a924467aba88481720d82e75f920df1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6f4b612a04b6cb024b0339db9cc31d19f005ccd90f8b41007638f0f0d189666cd3005f089619ffce462c474755107f2db09c5c1abe71c2da8da2aaca08fdddae
|
7
|
+
data.tar.gz: 63734695df3dafef2b086552b7148e7035c1ac5fb7bfb892b321da6772cacefe3ca9563b58c89e9375f872ee394e6c7222567e8f350f98f9301b5a000e0c298b
|
@@ -11,11 +11,15 @@ module GooglePerspective
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def valid?
|
14
|
-
|
14
|
+
result_score <= score
|
15
|
+
end
|
16
|
+
|
17
|
+
def result_score
|
18
|
+
result_scores.min
|
15
19
|
end
|
16
20
|
|
17
21
|
def result_scores
|
18
|
-
response['attributeScores'].map do |_model, model_score|
|
22
|
+
@result_scores ||= response['attributeScores'].map do |_model, model_score|
|
19
23
|
model_score.dig('summaryScore', 'value')
|
20
24
|
end
|
21
25
|
end
|