|
87 | 87 | my @ingredient_languages = qw/en fr/; |
88 | 88 |
|
89 | 89 | # caching directory for API responses |
90 | | -my $cache_dir = "foodture/api_cache"; |
| 90 | +my $cache_dir = "projects/foodture/tmp/api_cache"; |
91 | 91 | mkdir $cache_dir unless -d $cache_dir; |
92 | 92 |
|
93 | 93 | # variables for API fetching |
@@ -150,7 +150,7 @@ sub collect_ingredients { |
150 | 150 | } |
151 | 151 |
|
152 | 152 | # first pass: read ranked products and group by country/category tags |
153 | | -my $ranked_file = "foodture/ranked_products_202602231414.csv"; |
| 153 | +my $ranked_file = "projects/foodture/ranked_products_202602231414.csv"; |
154 | 154 | open my $RANK, '<:encoding(UTF-8)', $ranked_file or die "Cannot open $ranked_file: $!\n"; |
155 | 155 | <$RANK>; # skip header |
156 | 156 | my $parser = Text::CSV->new( |
@@ -188,12 +188,12 @@ sub collect_ingredients { |
188 | 188 | close $RANK; |
189 | 189 |
|
190 | 190 | # read target country/category pairs and output rows as we go |
191 | | -my $list_file = "foodture/16.06.2026_Correspondance_FT_OFF_pour_extract.csv"; |
| 191 | +my $list_file = "projects/foodture/foodture_foodex2_categories_mapping_to_off.csv"; |
192 | 192 | open my $LIST, '<:encoding(UTF-8)', $list_file or die "Cannot open $list_file: $!\n"; |
193 | 193 | <$LIST>; # skip header |
194 | 194 |
|
195 | 195 | # prepare output file |
196 | | -my $out_file = "foodture/representative_products.csv"; |
| 196 | +my $out_file = "projects/foodture/representative_products.csv"; |
197 | 197 | open my $OUT, '>:encoding(UTF-8)', $out_file or die "Cannot write $out_file: $!\n"; |
198 | 198 | my $csv_out = Text::CSV->new({binary => 1, eol => "\n"}) |
199 | 199 | or die "Cannot create CSV writer: " . Text::CSV->error_diag(); |
@@ -420,7 +420,7 @@ sub collect_ingredients { |
420 | 420 | close $OUT; |
421 | 421 |
|
422 | 422 | # Create a second CSV table that lists all ingredients with the sum of their percentages across all products |
423 | | -my $ingredients_file = "foodture/ingredients_sum.csv"; |
| 423 | +my $ingredients_file = "projects/foodture/ingredients_sum.csv"; |
424 | 424 | open my $ING_OUT, '>:encoding(UTF-8)', $ingredients_file or die "Cannot write $ingredients_file: $!\n"; |
425 | 425 | my @ingredients_header = ( |
426 | 426 | "ingredient_id", |
|
0 commit comments