Skip to content

Commit 436c0d4

Browse files
committed
Fix dépense annuelle regex - see HEA-846
This removes the regex for `(?:dépense annuelle|unité)` and the tests for it - because there are no BSSs that have that as a complete label. All the examples actually include the name of a product and need a regex like: `{product_pattern}{separator_pattern} (?:dépense annuelle|quantité annuelle)`
1 parent 682d8c6 commit 436c0d4

2 files changed

Lines changed: 27 additions & 5 deletions

File tree

pipelines/assets/livelihood_activity_regexes.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@
296296
"expenditure"
297297
],
298298
[
299-
"(?:dépense annuelle|unité)",
299+
"{product_pattern}{separator_pattern} (?:dépense annuelle|quantité annuelle)",
300300
null,
301301
true,
302302
"expenditure"

pipelines_tests/test_assets/test_livelihood_activity_regexes.json

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -865,13 +865,35 @@
865865
"dépense": {
866866
"attribute": "expenditure"
867867
},
868-
"dépense annuelle": {
868+
"ustensils de cuisine: dépense annuelle": {
869+
"activity_label": "ustensils de cuisine: dépense annuelle",
869870
"is_start": true,
870-
"attribute": "expenditure"
871+
"attribute": "expenditure",
872+
"product_id": "ustensils de cuisine"
871873
},
872-
"unité": {
874+
"electricité: dépense annuelle": {
875+
"activity_label": "electricité: dépense annuelle",
873876
"is_start": true,
874-
"attribute": "expenditure"
877+
"attribute": "expenditure",
878+
"product_id": "electricité"
879+
},
880+
"investissements en actifs: dépense annuelle": {
881+
"activity_label": "investissements en actifs: dépense annuelle",
882+
"is_start": true,
883+
"attribute": "expenditure",
884+
"product_id": "investissements en actifs"
885+
},
886+
"savon: quantité annuelle": {
887+
"activity_label": "savon: quantité annuelle",
888+
"is_start": true,
889+
"attribute": "expenditure",
890+
"product_id": "savon"
891+
},
892+
"sel: quantité annuelle": {
893+
"activity_label": "sel: quantité annuelle",
894+
"is_start": true,
895+
"attribute": "expenditure",
896+
"product_id": "sel"
875897
},
876898
"quantité (kg)": {
877899
"attribute": "quantity_produced_or_purchased",

0 commit comments

Comments
 (0)