Skip to content

Commit b2adb37

Browse files
committed
Capture product name using regex - see HEA-572
1 parent 084bf6e commit b2adb37

File tree

2 files changed

+16
-6
lines changed

2 files changed

+16
-6
lines changed

pipelines/assets/livelihood_activity_regexes.json

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -739,6 +739,12 @@
739739
false,
740740
"number_of_local_measures"
741741
],
742+
[
743+
"autre culture(?: de rente)?{separator_pattern} (?:type|nom)",
744+
null,
745+
true,
746+
"product__name"
747+
],
742748
[
743749
"autre culture{separator_pattern} \\(?{product_pattern}\\)?(?: type)?",
744750
null,
@@ -769,12 +775,6 @@
769775
true,
770776
"quantity_sold"
771777
],
772-
[
773-
"autre culture de rente: type",
774-
null,
775-
true,
776-
"product__name"
777-
],
778778
[
779779
"autre culture de rente: \\(?{product_pattern}\\)?",
780780
null,
@@ -793,6 +793,12 @@
793793
true,
794794
"quantity_sold"
795795
],
796+
[
797+
"{product_pattern}: (?P<unit_of_measure_id>kg|l)? {vendu_pattern}",
798+
null,
799+
true,
800+
"quantity_sold"
801+
],
796802
[
797803
"{product_pattern}: (?P<unit_of_measure_id>kg|l)? sold",
798804
null,

pipelines_tests/test_assets/test_livelihood_activity_regexes.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -519,6 +519,10 @@
519519
"is_start": true,
520520
"attribute": "product__name"
521521
},
522+
"Autre culture: nom": {
523+
"is_start": true,
524+
"attribute": "product__name"
525+
},
522526
"chou: qtité produite": {
523527
"is_start": true,
524528
"product_id": "chou",

0 commit comments

Comments
 (0)