food_ingredient_parser 1.0.0.pre.1 → 1.0.0.pre.2
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 +4 -4
- data/README.md +2 -0
- data/bin/food_ingredient_parser +1 -1
- data/lib/food_ingredient_parser/parser.rb +4 -0
- data/lib/food_ingredient_parser/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: 34aa98a295bf0f28f09aa2e97dff773c37779543
|
4
|
+
data.tar.gz: 4e998bc1799ab44bca0326c2ee5ef6509de21e82
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 282db6dd3f5b59aac5cddfa390dd5d5c482418e37e8e2cb6850c2c787ff857bedceac630fa0799f484b983acc70ca84ec82f4df89e0b9eb4e6ac1525e132101e
|
7
|
+
data.tar.gz: 82a1b55c8efab72d7df708f6cc5fbfe175743853bae255a485c5214135de5bfbd4c58f464b538ccb6cda209adc3faac2b65cc1d8740ecc0baa75cef347153d4e
|
data/README.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# Food ingredient parser
|
2
2
|
|
3
|
+
[](https://rubygems.org/gems/food_ingredient_parser)
|
4
|
+
|
3
5
|
Ingredients are listed on food products in various ways. This [Ruby](https://www.ruby-lang.org/)
|
4
6
|
gem and program parses the ingredient text and returns a structured representation.
|
5
7
|
|
data/bin/food_ingredient_parser
CHANGED
@@ -43,7 +43,7 @@ def parse_single(s, parsed=nil, parser: nil, verbosity: 1, print: nil, escape: f
|
|
43
43
|
puts(parsed.inspect) if verbosity > 1
|
44
44
|
pp(parsed.to_h, color: color) if verbosity > 0
|
45
45
|
else
|
46
|
-
puts "(no result: #{parser.failure_reason})" if verbosity > 0
|
46
|
+
puts "(no result: #{parser.parser.failure_reason})" if verbosity > 0
|
47
47
|
end
|
48
48
|
end
|
49
49
|
|
@@ -3,6 +3,10 @@ require_relative 'grammar'
|
|
3
3
|
module FoodIngredientParser
|
4
4
|
class Parser
|
5
5
|
|
6
|
+
# @!attribute [r] parser
|
7
|
+
# @return [Treetop::Runtime::CompiledParser] low-level parser object
|
8
|
+
attr_reader :parser
|
9
|
+
|
6
10
|
# Create a new food ingredient parser
|
7
11
|
# @return [FoodIngredientParser]
|
8
12
|
def initialize
|