Skip to content

Commit 1ec16a9

Browse files
authored
Merge pull request #213 from American-Institutes-for-Research/HEA-814/nbr-unites-locales
Add patterns for addressing nbr dunites .. patterns see HEA-814
2 parents b302fcc + 235d788 commit 1ec16a9

2 files changed

Lines changed: 25 additions & 2 deletions

File tree

pipelines/assets/livelihood_activity_regexes.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,12 @@
283283
false,
284284
"expenditure"
285285
],
286+
[
287+
"(?:dépense annuelle|unité)",
288+
null,
289+
true,
290+
"expenditure"
291+
],
286292
[
287293
"{nbr_pattern} (?:de )?fois / an(?:née)?",
288294
null,
@@ -752,13 +758,13 @@
752758
"percentage_monthly_kcals"
753759
],
754760
[
755-
"(?:autre culture)?{separator_pattern} ?{product_pattern}{separator_pattern} {nbr_pattern} (?:de mesures locales|d'unités locales|unités loc.)",
761+
"(?:autre culture)?{separator_pattern} ?{product_pattern}{separator_pattern} {nbr_pattern} (?:de mesures|mesures|d'unités|unités)(?: locales| loc\\.?)?",
756762
null,
757763
true,
758764
"number_of_local_measures"
759765
],
760766
[
761-
"{nbr_pattern} de mesures locales",
767+
"{nbr_pattern} (?:de mesures|mesures|d'unités|unités)(?: locales| loc\\.?)?",
762768
null,
763769
false,
764770
"number_of_local_measures"

pipelines_tests/test_assets/test_livelihood_activity_regexes.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,15 @@
571571
"product_id": "manioc",
572572
"attribute": "number_of_local_measures"
573573
},
574+
"nbr d'unités locales": {
575+
"attribute": "number_of_local_measures"
576+
},
577+
"nbr unités": {
578+
"attribute": "number_of_local_measures"
579+
},
580+
"nbr unités locales": {
581+
"attribute": "number_of_local_measures"
582+
},
574583
"nom de la mesure": {
575584
"attribute": "name_of_local_measure"
576585
},
@@ -832,6 +841,14 @@
832841
"dépense": {
833842
"attribute": "expenditure"
834843
},
844+
"dépense annuelle": {
845+
"is_start": true,
846+
"attribute": "expenditure"
847+
},
848+
"unité": {
849+
"is_start": true,
850+
"attribute": "expenditure"
851+
},
835852
"quantité (kg)": {
836853
"attribute": "quantity_produced_or_purchased",
837854
"unit_of_measure_id": "kg"

0 commit comments

Comments
 (0)