food_ingredient_parser 1.3.0 → 1.4.0
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/lib/food_ingredient_parser/strict/grammar/ingredient.treetop +8 -0
- data/lib/food_ingredient_parser/strict/grammar/ingredient_coloned.treetop +8 -0
- data/lib/food_ingredient_parser/strict/grammar/list.treetop +10 -0
- data/lib/food_ingredient_parser/strict/grammar/list_coloned.treetop +2 -1
- data/lib/food_ingredient_parser/strict/grammar/root.treetop +1 -1
- data/lib/food_ingredient_parser/version.rb +2 -2
- 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: 890abbbcdfd6531b7ad33fa89eeb00d25e6069b60c6c741c3495f838b3e7d8a8
|
4
|
+
data.tar.gz: 24b50c3ec559983fa228aa27274213047635b07ce74aa82e8617548c60376ae4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 758d0c351607a416fe801eb2ca839c831e6e996a39d528ffbc233b5dd15f895da6dc56adb79209d0736f25ece1217d3bcf696e395c80a038e70dc674d0669ef8
|
7
|
+
data.tar.gz: 5a36027d26908085f56e6e976dcb992cc422225830e99befed59e32475516f5fe5c642e9db27e28f47466a17519c25e46f1f8c601385432e55680089deac0c9d
|
@@ -14,6 +14,14 @@ module FoodIngredientParser::Strict::Grammar
|
|
14
14
|
contains:( ingredient_coloned_simple_with_amount_and_nest ( ws* '/'+ ws* ingredient_coloned_simple_with_amount_and_nest )* ) <ListNode>
|
15
15
|
end
|
16
16
|
|
17
|
+
rule ingredient_coloned_semicol
|
18
|
+
ing:ingredient_simple ws* ':' post:( ws* '}' )? ws* contains:( ingredient_coloned_semicol_inner_list ) ';' <NestedIngredientNode>
|
19
|
+
end
|
20
|
+
|
21
|
+
rule ingredient_coloned_semicol_inner_list
|
22
|
+
contains:( ingredient_coloned_simple_with_amount_and_nest ( ws* ',' ws* ingredient_coloned_simple_with_amount_and_nest )* ) <ListNode>
|
23
|
+
end
|
24
|
+
|
17
25
|
# @see IngredientSimple#ingredient_simple
|
18
26
|
rule ingredient_coloned_simple
|
19
27
|
name:( ingredient_coloned_word ( ws+ !amount ingredient_coloned_word )* ) ws? mark:mark <IngredientNode> /
|
@@ -2,8 +2,10 @@ module FoodIngredientParser::Strict::Grammar
|
|
2
2
|
grammar List
|
3
3
|
include Common
|
4
4
|
include Ingredient
|
5
|
+
include IngredientColoned
|
5
6
|
|
6
7
|
rule list
|
8
|
+
list_coloned_semicol /
|
7
9
|
contains:(ingredient ( ws* '|' ws* ingredient )+ ( ws+ and ws+ ingredient )? ) <ListNode> /
|
8
10
|
contains:(ingredient ( ws* ';' ws* ingredient )+ ( ws+ and ws+ ingredient )? ) <ListNode> /
|
9
11
|
contains:(ingredient ( ws* ',' ws* ingredient )+ ( ws+ and ws+ ingredient )? ) <ListNode> /
|
@@ -12,5 +14,13 @@ module FoodIngredientParser::Strict::Grammar
|
|
12
14
|
contains:(ingredient_simple_e_number ( ws* dash ws* ingredient_simple_e_number )+ ) <ListNode> /
|
13
15
|
contains:(ingredient ( ws+ and ws+ ingredient )? ) <ListNode>
|
14
16
|
end
|
17
|
+
|
18
|
+
rule list_coloned_semicol
|
19
|
+
contains:(
|
20
|
+
( (ingredient_nocol ws* ',' ws*)* ws* ingredient_coloned_semicol )+
|
21
|
+
( ws* ingredient_nocol (ws* ',' ws* ingredient_nocol)* )?
|
22
|
+
( ws+ and ws+ ingredient_nocol )?
|
23
|
+
) <ListNode>
|
24
|
+
end
|
15
25
|
end
|
16
26
|
end
|
@@ -17,9 +17,10 @@ module FoodIngredientParser::Strict::Grammar
|
|
17
17
|
end
|
18
18
|
|
19
19
|
rule list_coloned_inner_list
|
20
|
+
contains:( ingredient ( ws* ',' ws* ingredient )+ ( ws+ and ws+ ingredient )? ) <ListNode> /
|
20
21
|
contains:( ingredient_simple_e_number ( ws* '/' ws* ingredient_simple_e_number )+ ) <ListNode> /
|
21
22
|
contains:( ingredient_simple_e_number ( ws* dash ws* ingredient_simple_e_number )+ ) <ListNode> /
|
22
|
-
contains:( ingredient ( ws
|
23
|
+
contains:( ingredient ( ws+ and ws+ ingredient )? ) <ListNode>
|
23
24
|
end
|
24
25
|
|
25
26
|
rule list_coloned_ingredient
|
@@ -8,7 +8,7 @@ module FoodIngredientParser::Strict::Grammar
|
|
8
8
|
rule root
|
9
9
|
'"'?
|
10
10
|
root_prefix? ws*
|
11
|
-
contains:( list_newlined / list_coloned / list )
|
11
|
+
contains:( list_newlined / list_coloned_semicol / list_coloned / list )
|
12
12
|
notes:(
|
13
13
|
root_mark_sentences_in_list? ws*
|
14
14
|
( ( [.;] ws* newline* / [.;]? ws* newline+ ) ws* root_sentences? ws* )?
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: food_ingredient_parser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- wvengen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-06-
|
11
|
+
date: 2024-06-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: treetop
|