inci_score 4.5.0 → 4.5.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 462ec33d1c493272235feaef061ac62822c4dfd6ad6c339e858da8fdfa491894
4
- data.tar.gz: 42f1e47b971185e92d4af19f2fbdee0f363dc9f241041b8ed800230ae9bd0e22
3
+ metadata.gz: c8d0453d792d9a6f5e628d13720a927c15ee14ba8441faf588736b22ab8bf618
4
+ data.tar.gz: d354ebb76fa432acc592da8e152e6a9712022c394cce7e8f951e6ebc9f94b93a
5
5
  SHA512:
6
- metadata.gz: cc4f049d56ea9fc60ce92943d7da50c15b697f8712733b409e3327ab73b3c4c0e60d0687f55fcbbefb9f4fd2fdc4c05fe5aa86435f5b75fb558bf456744c9cc4
7
- data.tar.gz: a706360921a1cc36b1b5f1fef53932b859de69a27b02fd8b662b76dc8fe9808e1409779297bfa159c0d57bc6bb1dfb6e5287d4455def84500ce194fa0102706a
6
+ metadata.gz: dcfc4fcafe3b51ed9917937c36055c4043591b499250eae36be97cf4b58d101d0440bc12a57a2fe8e22c5fb4189ed20969cd6f0ab7f58cfa9028fa2ea681fda6
7
+ data.tar.gz: a34557698ffc1449c4ae4d4bb031465566506e92186c7a6e482ff655453566581d3645f8e78894d5afec6a3feb6066d887d30063356b6d3a91b408204a1a6ed4
data/README.md CHANGED
@@ -57,7 +57,7 @@ You can include this gem into your own library and start computing the INCI scor
57
57
  require "inci_score"
58
58
 
59
59
  inci = InciScore::Computer.new(src: 'aqua, dimethicone').call
60
- inci.score # 53.76
60
+ inci.score # 56.25
61
61
  ```
62
62
 
63
63
  As you see the results are wrapped by an *InciScore::Response* object, this is useful when dealing with the CLI and HTTP interfaces (read below).
@@ -40,7 +40,11 @@ module InciScore
40
40
  end
41
41
 
42
42
  def weight(index)
43
- Math.log(index+1, size * WEIGHT_FACTOR)
43
+ Math.log(index + 1, size * ratio(index))
44
+ end
45
+
46
+ def ratio(index)
47
+ WEIGHT_FACTOR / (index + 1)
44
48
  end
45
49
  end
46
50
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module InciScore
4
- VERSION = '4.5.0'
4
+ VERSION = '4.5.1'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: inci_score
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.5.0
4
+ version: 4.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - costajob