inci_score 4.6.2 → 4.6.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +6 -2
- data/lib/inci_score/computer.rb +1 -1
- data/lib/inci_score/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fbbf88644bed7f8afcd802d796c2b49a2428a2eac2bbf68761079b83bc485866
|
4
|
+
data.tar.gz: 014d402eacfdb5512b350fdb7131dee8ebc793df1091153b30c04e000e47d161
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 44d96ce1e40671e04de3f9120465a129abbbc6bbd104c0e639d78be6d03be52645dedad5f5c22f7ff0c2d02c115fbf32d6941e38d9aa86867f9e4e38763719d3
|
7
|
+
data.tar.gz: 4dcfd975146932d346b4ba693621fd00762b83071b6cf91db73757bec4271d530ab253b42a2e647c661d8e37712682e4cef51c9befa0a5b6717232ddc785b77d
|
data/README.md
CHANGED
@@ -31,11 +31,13 @@ The total score is then calculated on a percent basis.
|
|
31
31
|
Since the ingredients list could come from an unreliable source (e.g. data scanned from a captured image), the gem tries to fuzzy match the ingredients by using different algorithms:
|
32
32
|
* exact matching
|
33
33
|
* [edit distance](https://en.wikipedia.org/wiki/Levenshtein_distance) behind a specified tolerance
|
34
|
+
* known hazards (ie ending in `ethicone`)
|
34
35
|
* first relevant matching digits
|
35
36
|
* matching splitted tokens
|
36
37
|
|
37
38
|
### Sources
|
38
|
-
The library accepts the list of ingredients as a single string of text.
|
39
|
+
The library accepts the list of ingredients as a single string of text.
|
40
|
+
Since this source could come from an OCR program, the library performs a normalization by stripping invalid characters and removing the unimportant parts.
|
39
41
|
The ingredients are typically separated by comma, although normalizer will detect the most appropriate separator:
|
40
42
|
|
41
43
|
```
|
@@ -44,6 +46,7 @@ The ingredients are typically separated by comma, although normalizer will detec
|
|
44
46
|
|
45
47
|
## Installation
|
46
48
|
Install the gem from your shell:
|
49
|
+
|
47
50
|
```shell
|
48
51
|
gem install inci_score
|
49
52
|
```
|
@@ -61,7 +64,7 @@ inci.score # 56.25
|
|
61
64
|
inci.precision # 100.0
|
62
65
|
```
|
63
66
|
|
64
|
-
As you see the results are wrapped by an *InciScore::Response* object, this is useful when dealing with the CLI
|
67
|
+
As you see the results are wrapped by an *InciScore::Response* object, this is useful when dealing with the CLI (read below).
|
65
68
|
|
66
69
|
#### Unrecognized components
|
67
70
|
The API treats unrecognized components as a common case by just marking the object as non valid.
|
@@ -94,6 +97,7 @@ UNRECOGNIZED:
|
|
94
97
|
|
95
98
|
#### Getting help
|
96
99
|
You can get CLI interface help by:
|
100
|
+
|
97
101
|
```shell
|
98
102
|
Usage: inci_score --src="aqua, parfum, etc"
|
99
103
|
-s, --src=SRC The INCI list: "aqua, parfum, etc"
|
data/lib/inci_score/computer.rb
CHANGED
data/lib/inci_score/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: inci_score
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.6.
|
4
|
+
version: 4.6.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- costajob
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-01-
|
11
|
+
date: 2023-01-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: oj
|