diff --git a/lib/ProductOpener/APIProductServices.pm b/lib/ProductOpener/APIProductServices.pm index e70ccbc068195..5e237833b239b 100644 --- a/lib/ProductOpener/APIProductServices.pm +++ b/lib/ProductOpener/APIProductServices.pm @@ -47,7 +47,10 @@ An array list of services to perform. Currently implemented services: - echo : does nothing, mostly for testing +- parse_ingredients_text : parse the ingredients text list and return an ingredients object +- extend_ingredients : extend the ingredients object with additional information - estimate_ingredients_percent : compute percent_min, percent_max, percent_estimate for each ingredient in the ingredients object +- analyze_ingredients : analyze the ingredients object and return a summary object =head4 product @@ -90,17 +93,23 @@ use ProductOpener::API qw/add_error customize_response_for_product/; use Encode; -=head2 echo_service ($product_ref) +=head2 echo_service ($product_ref, $updated_product_fields_ref, $errors_ref) Echo service that returns the input product unchanged. =cut -sub echo_service ($product_ref, $updated_product_fields_ref) { +sub echo_service ($product_ref, $updated_product_fields_ref, $errors_ref) { return; } +=head2 Service function handlers + +They will be called with the input product object, a reference to the updated fields hash, and a reference to the errors array. + +=cut + my %service_functions = ( echo => \&echo_service, parse_ingredients_text => \&ProductOpener::Ingredients::parse_ingredients_text_service, @@ -191,6 +200,12 @@ sub product_services_api ($request_ref) { if (not $error) { my $product_ref = $request_body_ref->{product}; + # Normalization of some fields like lc / lang + normalize_product_data($product_ref); + + # TODO: check that the product object is valid + # any input product data can be sent, and most of the services expect a specific structure + # they may crash and return a 500 error if the input data is not as expected (e.g. hash instead of array) # We will track of fields updated by the services so that we can return only those fields # if the fields parameter value is "updated" @@ -199,7 +214,7 @@ sub product_services_api ($request_ref) { foreach my $service (@{$request_body_ref->{services}}) { my $service_function = $service_functions{$service}; if (defined $service_function) { - &$service_function($product_ref, $request_ref->{updated_product_fields}); + &$service_function($product_ref, $request_ref->{updated_product_fields}, $response_ref->{errors}); } else { add_error( diff --git a/lib/ProductOpener/FoodProducts.pm b/lib/ProductOpener/FoodProducts.pm index f166aede69dc5..d9bee16874ec8 100644 --- a/lib/ProductOpener/FoodProducts.pm +++ b/lib/ProductOpener/FoodProducts.pm @@ -78,7 +78,7 @@ sub specific_processes_for_food_product ($product_ref) { # Ingredients analysis # Select best language to parse ingredients - $product_ref->{ingredients_lc} = select_ingredients_lc($product_ref); + select_ingredients_lc($product_ref); clean_ingredients_text($product_ref); extract_ingredients_from_text($product_ref); extract_additives_from_text($product_ref); diff --git a/lib/ProductOpener/Images.pm b/lib/ProductOpener/Images.pm index bc38c4b5e6eb8..85364f84f0479 100644 --- a/lib/ProductOpener/Images.pm +++ b/lib/ProductOpener/Images.pm @@ -1337,7 +1337,7 @@ sub process_image_crop ($user_id, $product_id, $id, $imgid, $angle, $normalize, } print STDERR - "image_crop.pl - imgid: $imgid - crop_size: $crop_size - x1: $x1, y1: $y1, x2: $x2, y2: $y2, w: $w, h: $h\n"; + "image_crop.pl - source_path: $source_path - product_id: $product_id - imgid: $imgid - crop_size: $crop_size - x1: $x1, y1: $y1, x2: $x2, y2: $y2, w: $w, h: $h\n"; $log->trace("calculating geometry", {crop_size => $crop_size, x1 => $x1, y1 => $y1, x2 => $x2, y2 => $y2, w => $w, h => $h}) if $log->is_trace(); diff --git a/lib/ProductOpener/Ingredients.pm b/lib/ProductOpener/Ingredients.pm index ca1eb050b9521..604851118e571 100644 --- a/lib/ProductOpener/Ingredients.pm +++ b/lib/ProductOpener/Ingredients.pm @@ -949,8 +949,6 @@ Array of specific ingredients. sub add_specific_ingredients_from_labels ($product_ref) { - my $ingredients_lc = $product_ref->{ingredients_lc} || $product_ref->{lc}; - if (defined $product_ref->{labels_tags}) { foreach my $labelid (@{$product_ref->{labels_tags}}) { my $ingredients = get_property("labels", $labelid, "ingredients:en"); @@ -1011,7 +1009,7 @@ Array of specific ingredients. sub parse_specific_ingredients_from_text ($product_ref, $text, $percent_or_quantity_regexp, $per_100g_regexp) { - my $ingredients_lc = $product_ref->{ingredients_lc} || $product_ref->{lc}; + my $ingredients_lc = get_or_select_ingredients_lc($product_ref); # Go through the ingredient lists multiple times # as long as we have one match @@ -1576,7 +1574,7 @@ sub parse_processing_from_ingredient ($ingredients_lc, $ingredient) { return (\@processings, $ingredient, $ingredient_id, $ingredient_recognized); } -=head2 parse_origins_from_text ( product_ref, $text) +=head2 parse_origins_from_text ( product_ref, $text, $ingredients_lc) This function parses the origins of ingredients field to extract the origins of specific ingredients. The origins are stored in the specific_ingredients structure of the product. @@ -1592,6 +1590,11 @@ while parse_origins_from_text() will also recognize text like "Strawberries: Spa =head4 text $text +=head4 $ingredients_lc : language for the origins text + +In most cases it is the same as $product_ref->{ingredients_lc}, except if there are no ingredients listed, +in which case we can have origins listed in the main language of the product. + =head3 Return values =head4 specific_ingredients structure @@ -1602,9 +1605,7 @@ Array of specific ingredients. =cut -sub parse_origins_from_text ($product_ref, $text) { - - my $ingredients_lc = $product_ref->{ingredients_lc} || $product_ref->{lc}; +sub parse_origins_from_text ($product_ref, $text, $ingredients_lc) { # Normalize single quotes $text =~ s/’/'/g; @@ -1661,30 +1662,77 @@ sub parse_origins_from_text ($product_ref, $text) { =head2 select_ingredients_lc ($product_ref) -Return the `ingredients_lc` field to save in $product_ref. +Select, set and return the `ingredients_lc` field in $product_ref. This is the language that will be used to parse ingredients. We first check that ingredients_text_{lang} exists and is non-empty for the product main language (`lc`), and return it if it does. Otherwise we look at all languages defined in `languages_codes` for a non-empty `ingredients_text_lang`. +If we find a language with non empty ingredients in ingredients_text_{lang}: +- we copy the value to the `ingredients_text` field in the product +- we set the `ingredients_lc` field in the product and return it, +otherwise we unset it. + =head3 Arguments =head4 $product_ref +=head3 Return values + +=head4 ingredients_lc + +Language code for ingredients parsing. + =cut sub select_ingredients_lc ($product_ref) { - if (defined $product_ref->{languages_codes}) { - # We sort the keys so that the order is deterministic - foreach my $language ($product_ref->{lc}, sort keys %{$product_ref->{languages_codes}}) { - if ( (defined $product_ref->{"ingredients_text_" . $language}) - and ($product_ref->{"ingredients_text_" . $language} ne "")) - { - return $language; - } + # Get all languages that have ingredients_text_{lang} defined, capture the language code + # Note: we don't use language_codes here, as it might not have been computed if we are called from a service + # with minimal product data + my @ingredients_text_fields = sort grep {/^ingredients_text_(\w\w)$/} (keys %$product_ref); + + # Put the main language first + unshift @ingredients_text_fields, "ingredients_text_" . $product_ref->{lc}; + + $log->debug("select_ingredients_lc - ingredients_text_fields", + {ingredients_text_fields => \@ingredients_text_fields}) + if $log->is_debug(); + + foreach my $ingredient_text_field (@ingredients_text_fields) { + if ( (defined $product_ref->{$ingredient_text_field}) + and ($product_ref->{$ingredient_text_field} ne "")) + { + $product_ref->{ingredients_text} = $product_ref->{$ingredient_text_field}; + my $language = substr($ingredient_text_field, -2); + $product_ref->{ingredients_lc} = $language; + return $language; } } - return $product_ref->{lc}; + + # If we have ingredients_text set (but no ingredients_text_{lang}), we use the main language of the product + # This might happen with very old revisions before we had language specific fields + # or in unit test cases + if ( (defined $product_ref->{ingredients_text}) + and ($product_ref->{ingredients_text} ne "") + and (defined $product_ref->{lc})) + { + $product_ref->{ingredients_lc} = $product_ref->{lc}; + return $product_ref->{lc}; + } + delete $product_ref->{ingredients_lc}; + return; +} + +=head2 get_or_select_ingredients_lc ($product_ref) + +Return the ingredients_lc field if already set, otherwise call select_ingredients_lc() to select it. + +This function is used in ingredients related services, to ensure that the ingredients_lc field is set. + +=cut + +sub get_or_select_ingredients_lc ($product_ref) { + return $product_ref->{ingredients_lc} || select_ingredients_lc($product_ref); } =head2 get_percent_or_quantity_and_normalized_quantity($percent_or_quantity_value, $percent_or_quantity_unit) @@ -1739,7 +1787,7 @@ sub get_percent_or_quantity_and_normalized_quantity ($percent_or_quantity_value, return ($percent, $quantity, $quantity_g); } -=head2 parse_ingredients_text_service ( $product_ref, $updated_product_fields_ref ) +=head2 parse_ingredients_text_service ( $product_ref, $updated_product_fields_ref, $errors_ref ) Parse the ingredients_text field to extract individual ingredients. @@ -1755,9 +1803,13 @@ product object reference reference to a hash of product fields that have been created or updated +=head4 $errors_ref + +reference to an array of error messages + =cut -sub parse_ingredients_text_service ($product_ref, $updated_product_fields_ref) { +sub parse_ingredients_text_service ($product_ref, $updated_product_fields_ref, $errors_ref) { my $debug_ingredients = 0; @@ -1766,15 +1818,47 @@ sub parse_ingredients_text_service ($product_ref, $updated_product_fields_ref) { # and indicate that the service is creating the "ingredients" structure $updated_product_fields_ref->{ingredients} = 1; - return if ((not defined $product_ref->{ingredients_text}) or ($product_ref->{ingredients_text} eq "")); + my $ingredients_lc = get_or_select_ingredients_lc($product_ref); + + if ( (not defined $product_ref->{ingredients_text}) + or ($product_ref->{ingredients_text} eq "") + or (not defined $ingredients_lc)) + { + $log->debug( + "parse_ingredients_text_service - missing ingredients_text or ingredients_lc", + {ingredients_text => $product_ref->{ingredients_text}, ingredients_lc => $ingredients_lc} + ) if $log->is_debug(); + if ((not defined $product_ref->{ingredients_text}) or ($product_ref->{ingredients_text} eq "")) { + + push @{$errors_ref}, + { + message => {id => "missing_field"}, + field => { + id => "ingredients_text", + impact => {id => "skipped_service"}, + service => {id => "parse_ingredients_text"} + } + }; + } + if (not defined $ingredients_lc) { + push @{$errors_ref}, + { + message => {id => "missing_field"}, + field => { + id => "ingredients_lc", + impact => {id => "skipped_service"}, + service => {id => "parse_ingredients_text"} + } + }; + } + + return; + } my $text = $product_ref->{ingredients_text}; $log->debug("extracting ingredients from text", {text => $text}) if $log->is_debug(); - # $product_ref->{ingredients_lc} is defined in extract_ingredients_from_text() - my $ingredients_lc = $product_ref->{ingredients_lc} || $product_ref->{lc}; - $text = preparse_ingredients_text($ingredients_lc, $text); $log->debug("preparsed ingredients from text", {text => $text}) if $log->is_debug(); @@ -2983,13 +3067,13 @@ sub parse_ingredients_text_service ($product_ref, $updated_product_fields_ref) { return; } -=head2 extend_ingredients_service ( $product_ref, $updated_product_fields_ref ) +=head2 extend_ingredients_service ( $product_ref, $updated_product_fields_ref, $errors_ref ) After the nested ingredients structure has been built with the parse_ingredients_text_service, this service adds some properties to the ingredients: - Origins, labels etc. that have been extracted from other fields -- Ciqual codes +- Ciqual and Ecobalyse codes =head3 Arguments @@ -3001,11 +3085,18 @@ product object reference reference to a hash of product fields that have been created or updated +=head4 $errors_ref + +reference to an array of error messages + =cut -sub extend_ingredients_service ($product_ref, $updated_product_fields_ref) { +sub extend_ingredients_service ($product_ref, $updated_product_fields_ref, $errors_ref) { - # and indicate that the service is creating the "ingredients" structure + # Do nothing and return if we don't have the ingredients structure + return if not defined $product_ref->{ingredients}; + + # indicate that the service is modifying the "ingredients" structure $updated_product_fields_ref->{ingredients} = 1; # Add properties like origins from specific ingredients extracted from labels or the end of the ingredients list @@ -3125,7 +3216,7 @@ sub compute_ingredients_tags ($product_ref) { my $field = "ingredients"; $product_ref->{ingredients_original_tags} = $product_ref->{ingredients_tags}; - my $ingredients_lc = $product_ref->{ingredients_lc} || $product_ref->{lc}; + my $ingredients_lc = get_or_select_ingredients_lc($product_ref); if (defined $taxonomy_fields{$field}) { $product_ref->{$field . "_hierarchy"} = [ @@ -3193,12 +3284,15 @@ sub extract_ingredients_from_text ($product_ref) { $product_ref->{specific_ingredients} = []; - my $ingredients_lc = $product_ref->{ingredients_lc} || $product_ref->{lc}; + # It is possible that we could have origins info listed without having ingredients listed + # (also in unit tests) + # so we fall back to the main language of the product in that case + my $origin_lc = get_or_select_ingredients_lc($product_ref) || $product_ref->{lc}; # Ingredients origins may be listed in the origin field # e.g. "Origin of the rice: Thailand." - if (defined $product_ref->{"origin_" . $ingredients_lc}) { - parse_origins_from_text($product_ref, $product_ref->{"origin_" . $ingredients_lc}); + if (defined $product_ref->{"origin_" . $origin_lc}) { + parse_origins_from_text($product_ref, $product_ref->{"origin_" . $origin_lc}, $origin_lc); } # Add specific ingredients from labels @@ -3207,16 +3301,16 @@ sub extract_ingredients_from_text ($product_ref) { # Parse the ingredients list to extract individual ingredients and sub-ingredients # to create the ingredients array with nested sub-ingredients arrays - parse_ingredients_text_service($product_ref, {}); + parse_ingredients_text_service($product_ref, {}, []); if (defined $product_ref->{ingredients}) { # - Add properties like origins from specific ingredients extracted from labels or the end of the ingredients list # - Obtain Ciqual codes ready for ingredients estimation from nutrients - extend_ingredients_service($product_ref, {}); + extend_ingredients_service($product_ref, {}, []); # Compute minimum and maximum percent ranges and percent estimates for each ingredient and sub ingredient - estimate_ingredients_percent_service($product_ref, {}); + estimate_ingredients_percent_service($product_ref, {}, []); estimate_nutriscore_2021_fruits_vegetables_nuts_percent_from_ingredients($product_ref); estimate_nutriscore_2023_fruits_vegetables_legumes_percent_from_ingredients($product_ref); @@ -3254,7 +3348,7 @@ sub extract_ingredients_from_text ($product_ref) { # Analyze ingredients to see the ones that are vegan, vegetarian, from palm oil etc. # and compute the resulting value for the complete product - analyze_ingredients_service($product_ref, {}); + analyze_ingredients_service($product_ref, {}, []); # Delete specific ingredients if empty if ((exists $product_ref->{specific_ingredients}) and (scalar @{$product_ref->{specific_ingredients}} == 0)) { @@ -3418,7 +3512,7 @@ sub get_missing_ecobalyse_ids ($ingredients_ref) { return @ingredients_without_ecobalyse_ids; } -=head2 estimate_ingredients_percent_service ( $product_ref, $updated_product_fields_ref ) +=head2 estimate_ingredients_percent_service ( $product_ref, $updated_product_fields_ref, $errors_ref ) Compute minimum and maximum percent ranges and percent estimates for each ingredient and sub ingredient. @@ -3434,9 +3528,16 @@ product object reference reference to a hash of product fields that have been created or updated +=head4 $errors_ref + +reference to an array of error messages + =cut -sub estimate_ingredients_percent_service ($product_ref, $updated_product_fields_ref) { +sub estimate_ingredients_percent_service ($product_ref, $updated_product_fields_ref, $errors_ref) { + + # Do nothing and return if we don't have the ingredients structure + return if not defined $product_ref->{ingredients}; # Add a percent_max value for salt and sugar ingredients, based on the nutrition facts. add_percent_max_for_ingredients_from_nutrition_facts($product_ref); @@ -4161,7 +4262,7 @@ sub compute_ingredients_percent_estimates ($total, $ingredients_ref) { return; } -=head2 analyze_ingredients ( $product_ref, $updated_product_fields_ref ) +=head2 analyze_ingredients_service ( $product_ref, $updated_product_fields_ref, $errors_ref ) Analyzes ingredients to see the ones that are vegan, vegetarian, from palm oil etc. and computes the resulting value for the complete product. @@ -4182,9 +4283,13 @@ product object reference reference to a hash of product fields that have been created or updated +=head4 $errors_ref + +reference to an array of error messages + =cut -sub analyze_ingredients_service ($product_ref, $updated_product_fields_ref) { +sub analyze_ingredients_service ($product_ref, $updated_product_fields_ref, $errors_ref) { # Delete any existing values for the ingredients analysis fields delete $product_ref->{ingredients_analysis}; @@ -5933,7 +6038,8 @@ my @symbols = ('\*\*\*', '\*\*', '\*', '°°°', '°°', '°', '\(1\)', '\(2\)', my $symbols_regexp = join('|', @symbols); sub develop_ingredients_categories_and_types ($ingredients_lc, $text) { - $log->debug("develop_ingredients_categories_and_types: start with>$text<") if $log->is_debug(); + $log->debug("develop_ingredients_categories_and_types", {ingredients_lc => $ingredients_lc, text => $text}) + if $log->is_debug(); if (defined $ingredients_categories_and_types{$ingredients_lc}) { @@ -6578,6 +6684,8 @@ sub preparse_ingredients_text ($ingredients_lc, $text) { This function extracts additives from the ingredients text and adds them to the product_ref in the additives_tags array. +TODO: this function is independent of the ingredient parsing, we should combine the two. + =head3 Arguments =head4 Product reference @@ -6608,10 +6716,12 @@ sub extract_additives_from_text ($product_ref) { delete $product_ref->{ingredients_sweeteners_n}; delete $product_ref->{ingredients_non_nutritive_sweeteners_n}; - if (not defined $product_ref->{ingredients_text}) { + my $ingredients_lc = get_or_select_ingredients_lc($product_ref); + + if ((not defined $product_ref->{ingredients_text}) or (not defined $ingredients_lc)) { return; } - my $ingredients_lc = $product_ref->{ingredients_lc} || $product_ref->{lc}; + my $text = preparse_ingredients_text($ingredients_lc, $product_ref->{ingredients_text}); # do not match anything if we don't have a translation for "and" my $and = $and{$ingredients_lc} || " will not match "; @@ -7195,7 +7305,7 @@ sub count_sweeteners_and_non_nutritive_sweeteners ($product_ref) { sub replace_allergen ($language, $product_ref, $allergen, $before) { - my $ingredients_lc = $product_ref->{ingredients_lc} || $product_ref->{lc}; + my $ingredients_lc = get_or_select_ingredients_lc($product_ref); my $field = "allergens"; my $traces_regexp = $may_contain_regexps{$language}; @@ -7217,7 +7327,7 @@ sub replace_allergen ($language, $product_ref, $allergen, $before) { sub replace_allergen_in_caps ($language, $product_ref, $allergen, $before) { - my $ingredients_lc = $product_ref->{ingredients_lc} || $product_ref->{lc}; + my $ingredients_lc = get_or_select_ingredients_lc($product_ref); my $field = "allergens"; my $traces_regexp = $may_contain_regexps{$language}; @@ -7243,7 +7353,7 @@ sub replace_allergen_in_caps ($language, $product_ref, $allergen, $before) { sub replace_allergen_between_separators ($language, $product_ref, $start_separator, $allergen, $end_separator, $before) { - my $ingredients_lc = $product_ref->{ingredients_lc} || $product_ref->{lc}; + my $ingredients_lc = get_or_select_ingredients_lc($product_ref); my $field = "allergens"; #print STDERR "replace_allergen_between_separators - allergen: $allergen\n"; @@ -7451,7 +7561,7 @@ sub detect_allergens_from_text ($product_ref) { init_allergens_regexps(); } - my $ingredients_lc = $product_ref->{ingredients_lc} || $product_ref->{lc}; + my $ingredients_lc = get_or_select_ingredients_lc($product_ref); # Keep allergens entered by users in the allergens and traces field @@ -7547,8 +7657,9 @@ sub detect_allergens_from_text ($product_ref) { # Use the language the tag have been entered in my $traces_regexp; - if (defined $may_contain_regexps{$product_ref->{traces_lc} || $ingredients_lc}) { - $traces_regexp = $may_contain_regexps{$product_ref->{traces_lc} || $ingredients_lc}; + my $traces_lc = $product_ref->{traces_lc} || $product_ref->{lc}; + if ((defined $traces_lc) and (defined $may_contain_regexps{$traces_lc})) { + $traces_regexp = $may_contain_regexps{$traces_lc}; } if ( (defined $traces_regexp) @@ -7570,7 +7681,7 @@ sub detect_allergens_from_text ($product_ref) { # regenerate allergens and traces from the allergens_tags field so that it is prefixed with the values in the # main language of the product (which may be different than the $tag_lc language of the interface) - my $tag_lc = $product_ref->{$field . "_lc"} || $ingredients_lc || "?"; + my $tag_lc = $product_ref->{$field . "_lc"} || $product_ref->{lc} || "?"; $product_ref->{$field . "_from_user"} = "($tag_lc) " . ($product_ref->{$field} // ""); $product_ref->{$field . "_hierarchy"} = [gen_tags_hierarchy_taxonomy($tag_lc, $field, $product_ref->{$field})]; $product_ref->{$field} = join(',', @{$product_ref->{$field . "_hierarchy"}}); @@ -7586,11 +7697,13 @@ sub detect_allergens_from_text ($product_ref) { $allergens .= ", " . $product_ref->{$field}; } - $product_ref->{$field . "_hierarchy"} = [gen_tags_hierarchy_taxonomy($ingredients_lc, $field, $allergens)]; + $product_ref->{$field . "_hierarchy"} + = [gen_tags_hierarchy_taxonomy($ingredients_lc || $product_ref->{lc}, $field, $allergens)]; $product_ref->{$field . "_tags"} = []; # print STDERR "result for $field : "; foreach my $tag (@{$product_ref->{$field . "_hierarchy"}}) { - push @{$product_ref->{$field . "_tags"}}, get_allergens_taxonomyid($ingredients_lc, $tag); + push @{$product_ref->{$field . "_tags"}}, + get_allergens_taxonomyid($ingredients_lc || $product_ref->{lc}, $tag); # print STDERR " - $tag"; } # print STDERR "\n"; diff --git a/lib/ProductOpener/Products.pm b/lib/ProductOpener/Products.pm index 5e10c3ce1638f..93200d7e91f45 100644 --- a/lib/ProductOpener/Products.pm +++ b/lib/ProductOpener/Products.pm @@ -78,6 +78,7 @@ BEGIN { &product_id_from_path &product_exists &get_owner_id + &normalize_product_data &init_product &retrieve_product &retrieve_product_rev @@ -879,6 +880,8 @@ sub retrieve_product ($product_id, $include_deleted = 0) { } } + normalize_product_data($product_ref); + return $product_ref; } @@ -909,6 +912,8 @@ sub retrieve_product_rev ($product_id, $rev, $include_deleted = 0) { } } + normalize_product_data($product_ref); + return $product_ref; } @@ -1559,20 +1564,33 @@ sub compute_data_sources ($product_ref, $changes_ref) { return; } +=head2 normalize_product_data($product_ref) + +Function to do some normalization of product data (from the product database or input product data from a service) + +=cut + +sub normalize_product_data($product_ref) { + + # We currently have two fields lang and lc that are used to store the main language of the product + # TODO: at some point, we should keep only one field + # In theory, they should always have a value (defaulting to English), and they should be the same + # It is possible that in some situations, one or the other is missing + # e.g. when a product service is called directly with product data, and the product is not loaded + # through the database or the .sto file. + # some old revisions may also have missing values + + my $main_lc = $product_ref->{lc} || $product_ref->{lang} || "en"; + $product_ref->{lang} = $main_lc; + $product_ref->{lc} = $main_lc; + + return; +} + sub compute_completeness_and_missing_tags ($product_ref, $current_ref, $previous_ref) { + normalize_product_data($product_ref); my $lc = $product_ref->{lc}; - if (not defined $lc) { - # Try lang field - if (defined $product_ref->{lang}) { - $lc = $product_ref->{lang}; - } - else { - $lc = "en"; - $product_ref->{lang} = "en"; - } - $product_ref->{lc} = $lc; - } # Compute completeness and missing tags diff --git a/stop_words.txt b/stop_words.txt index 18d65d8f0627d..8b7e67bb3b9cb 100644 --- a/stop_words.txt +++ b/stop_words.txt @@ -69,6 +69,7 @@ dont dropdown du ecoscore +Ecobalyse EAN EANs eg diff --git a/tests/integration/api_v2_product_write.t b/tests/integration/api_v2_product_write.t index 874f0598f4b31..48219eb218511 100644 --- a/tests/integration/api_v2_product_write.t +++ b/tests/integration/api_v2_product_write.t @@ -120,6 +120,7 @@ my $tests_ref = [ quantity => "250 g", serving_size => '20 g', ingredients_text => "Pork meat, salt", + traces => "Moutarde, milk, abcd", } }, { diff --git a/tests/integration/api_v3_product_services.t b/tests/integration/api_v3_product_services.t index 5bae5d84d0967..eae5f9792a7e2 100644 --- a/tests/integration/api_v3_product_services.t +++ b/tests/integration/api_v3_product_services.t @@ -113,6 +113,69 @@ my $tests_ref = [ "services":["estimate_ingredients_percent", "analyze_ingredients"],' . $product_hazelnut_spread_json . '}', }, + + # parse_ingredients_text missing ingredients + { + test_case => 'parse-ingredients-text-service-missing-ingredients', + method => 'POST', + path => '/api/v3/product_services', + body => < 'parse-ingredients-text-service-lc-fr', + method => 'POST', + path => '/api/v3/product_services', + body => < 'parse-ingredients-text-service-no-lc', + method => 'POST', + path => '/api/v3/product_services', + body => < 'parse-ingredients-text-service-ingredients-text-fr', + method => 'POST', + path => '/api/v3/product_services', + body => < "2000000000001"); +my %product_ok = (%default_product, code => "2000000000001", lc => "en"); # int code my %product_int_code = (%default_product, code => 2000000000002); my %product_int_code_deleted = (%default_product, code => 2000000000003, deleted => "on"); @@ -133,7 +133,7 @@ is($product_ref, \%product_ok); # product has no more int code $product_ref = retrieve_product("2000000000002"); -%fixed_product = (%product_int_code, code => "2000000000002", _id => "2000000000002"); +%fixed_product = (%product_int_code, code => "2000000000002", _id => "2000000000002", lc => "en"); is($product_ref, \%fixed_product); $product_ref = $products_collection->find_id("2000000000002"); is($product_ref, \%fixed_product); @@ -141,7 +141,7 @@ $product_ref = $products_collection->find_id(2000000000002); is($product_ref, undef); # product has no more int code even deleted $product_ref = retrieve_product("2000000000003", "include_deleted"); -%fixed_product = (%product_int_code_deleted, code => "2000000000003", _id => "2000000000003"); +%fixed_product = (%product_int_code_deleted, code => "2000000000003", _id => "2000000000003", lc => "en"); is($product_ref, \%fixed_product); # but not indexed is($products_collection->find_id("2000000000003"), undef); @@ -154,7 +154,7 @@ is(retrieve_product("2000000000004"), undef); # product normalized $product_ref = retrieve_product("12345678"); -%fixed_product = (%product_non_normalized_code, code => "12345678", _id => "12345678", rev => "1"); +%fixed_product = (%product_non_normalized_code, code => "12345678", _id => "12345678", rev => "1", lc => "en"); # pop some inconvenient field remove_non_relevant_fields($product_ref, \%fixed_product); is($product_ref, \%fixed_product); diff --git a/tests/unit/allergens.t b/tests/unit/allergens.t index 58634dccfe808..0995722f1fc6c 100644 --- a/tests/unit/allergens.t +++ b/tests/unit/allergens.t @@ -411,6 +411,8 @@ is( 'allergens_from_ingredients' => "Saumon, oeufs, bl\x{e9}", 'allergens_hierarchy' => ['en:eggs', 'en:fish', 'en:gluten', 'en:mustard'], 'allergens_tags' => ['en:eggs', 'en:fish', 'en:gluten', 'en:mustard'], + 'ingredients_lc' => 'fr', + 'ingredients_text' => "Saumon, oeufs, bl\x{e9}, chocolat", 'ingredients_text_fr' => "Saumon, oeufs, bl\x{e9}, chocolat", 'ingredients_text_with_allergens' => "Saumon, oeufs, bl\x{e9}, chocolat", @@ -451,6 +453,8 @@ is( 'allergens_from_ingredients' => '', 'allergens_hierarchy' => ['en:celery', 'en:crustaceans', 'en:lupin'], 'allergens_tags' => ['en:celery', 'en:crustaceans', 'en:lupin'], + 'ingredients_lc' => 'fr', + 'ingredients_text' => 'Filet de saumon sauvage', 'ingredients_text_fr' => 'Filet de saumon sauvage', 'ingredients_text_with_allergens' => 'Filet de saumon sauvage', 'ingredients_text_with_allergens_fr' => 'Filet de saumon sauvage', diff --git a/tests/unit/expected_test_results/attributes/en-ecoscore-score-at-20-threshold.json b/tests/unit/expected_test_results/attributes/en-ecoscore-score-at-20-threshold.json index 461c56aa54489..911d886142998 100644 --- a/tests/unit/expected_test_results/attributes/en-ecoscore-score-at-20-threshold.json +++ b/tests/unit/expected_test_results/attributes/en-ecoscore-score-at-20-threshold.json @@ -1,12 +1,9 @@ { - "additives_original_tags" : [], - "additives_tags" : [], "allergens" : "", "allergens_from_ingredients" : "", "allergens_from_user" : "(en) ", "allergens_hierarchy" : [], "allergens_tags" : [], - "amino_acids_tags" : [], "attribute_groups_en" : [ { "attributes" : [ @@ -780,7 +777,6 @@ "d" ], "food_groups_tags" : [], - "ingredients_lc" : "en", "ingredients_text" : "", "languages" : {}, "languages_codes" : {}, @@ -789,7 +785,6 @@ "en:0" ], "lc" : "en", - "minerals_tags" : [], "misc_tags" : [ "en:ecoscore-changed", "en:ecoscore-computed", @@ -821,7 +816,6 @@ "nova_groups_tags" : [ "unknown" ], - "nucleotides_tags" : [], "nutrient_levels" : {}, "nutrient_levels_tags" : [], "nutriments" : {}, @@ -890,7 +884,6 @@ "nutrition_score_debug" : "missing energy_100g - missing fat_100g - missing saturated-fat_100g - missing sugars_100g - missing sodium_100g - missing proteins_100g", "nutrition_score_warning_no_fiber" : 1, "nutrition_score_warning_no_fruits_vegetables_nuts" : 1, - "other_nutritional_substances_tags" : [], "packaging_materials_tags" : [], "packaging_recycling_tags" : [], "packaging_shapes_tags" : [], @@ -911,6 +904,5 @@ "traces_from_user" : "(en) ", "traces_hierarchy" : [], "traces_tags" : [], - "unknown_nutrients_tags" : [], - "vitamins_tags" : [] + "unknown_nutrients_tags" : [] } diff --git a/tests/unit/expected_test_results/attributes/en-no-ingredients.json b/tests/unit/expected_test_results/attributes/en-no-ingredients.json index 88970922c8872..4f2ccdb235c28 100644 --- a/tests/unit/expected_test_results/attributes/en-no-ingredients.json +++ b/tests/unit/expected_test_results/attributes/en-no-ingredients.json @@ -781,7 +781,6 @@ "en:milk-and-dairy-products", "en:cheese" ], - "ingredients_lc" : "en", "languages" : {}, "languages_codes" : {}, "languages_hierarchy" : [], diff --git a/tests/unit/expected_test_results/ecoscore/calvados-ingredients-no-origins.json b/tests/unit/expected_test_results/ecoscore/calvados-ingredients-no-origins.json index 2b63e8852d12b..09776eb6d1922 100644 --- a/tests/unit/expected_test_results/ecoscore/calvados-ingredients-no-origins.json +++ b/tests/unit/expected_test_results/ecoscore/calvados-ingredients-no-origins.json @@ -269,6 +269,7 @@ "en:wine", "en:alcohol" ], + "ingredients_lc" : "en", "ingredients_n" : 1, "ingredients_n_tags" : [ "1", diff --git a/tests/unit/expected_test_results/ecoscore/carrots-plastic.json b/tests/unit/expected_test_results/ecoscore/carrots-plastic.json index 7a1fe140dc33f..7201c2ae456fd 100644 --- a/tests/unit/expected_test_results/ecoscore/carrots-plastic.json +++ b/tests/unit/expected_test_results/ecoscore/carrots-plastic.json @@ -427,6 +427,7 @@ "en:root-vegetable", "en:taproot-vegetable" ], + "ingredients_lc" : "fr", "ingredients_n" : 1, "ingredients_n_tags" : [ "1", diff --git a/tests/unit/expected_test_results/ecoscore/carrots.json b/tests/unit/expected_test_results/ecoscore/carrots.json index 8b26b1869b09b..94e618914e079 100644 --- a/tests/unit/expected_test_results/ecoscore/carrots.json +++ b/tests/unit/expected_test_results/ecoscore/carrots.json @@ -431,6 +431,7 @@ "en:root-vegetable", "en:taproot-vegetable" ], + "ingredients_lc" : "fr", "ingredients_n" : 1, "ingredients_n_tags" : [ "1", diff --git a/tests/unit/expected_test_results/ecoscore/category-without-ecoscore-sodas.json b/tests/unit/expected_test_results/ecoscore/category-without-ecoscore-sodas.json index 10fdbcb8684b5..c0cbb93f0402a 100644 --- a/tests/unit/expected_test_results/ecoscore/category-without-ecoscore-sodas.json +++ b/tests/unit/expected_test_results/ecoscore/category-without-ecoscore-sodas.json @@ -278,6 +278,7 @@ "en:added-sugar", "en:disaccharide" ], + "ingredients_lc" : "en", "ingredients_n" : 2, "ingredients_n_tags" : [ "2", diff --git a/tests/unit/expected_test_results/ecoscore/energy-drink.json b/tests/unit/expected_test_results/ecoscore/energy-drink.json index 90dcd1ff8f9d7..0040ce5700e68 100644 --- a/tests/unit/expected_test_results/ecoscore/energy-drink.json +++ b/tests/unit/expected_test_results/ecoscore/energy-drink.json @@ -293,6 +293,7 @@ "en:water", "en:caffeine" ], + "ingredients_lc" : "fr", "ingredients_n" : 2, "ingredients_n_tags" : [ "2", diff --git a/tests/unit/expected_test_results/ecoscore/foie-gras.json b/tests/unit/expected_test_results/ecoscore/foie-gras.json index 5aaf352817051..64da028da3bf9 100644 --- a/tests/unit/expected_test_results/ecoscore/foie-gras.json +++ b/tests/unit/expected_test_results/ecoscore/foie-gras.json @@ -444,6 +444,7 @@ "en:duck", "en:duck-liver" ], + "ingredients_lc" : "fr", "ingredients_n" : 1, "ingredients_n_tags" : [ "1", diff --git a/tests/unit/expected_test_results/ecoscore/fr-verseur-en-plastique.json b/tests/unit/expected_test_results/ecoscore/fr-verseur-en-plastique.json index 05cbba720a8c0..22f4b29fd1356 100644 --- a/tests/unit/expected_test_results/ecoscore/fr-verseur-en-plastique.json +++ b/tests/unit/expected_test_results/ecoscore/fr-verseur-en-plastique.json @@ -459,6 +459,7 @@ "en:olive-oil", "en:virgin-olive-oil" ], + "ingredients_lc" : "fr", "ingredients_n" : 1, "ingredients_n_tags" : [ "1", diff --git a/tests/unit/expected_test_results/ecoscore/fr-viande-porcine-francaise.json b/tests/unit/expected_test_results/ecoscore/fr-viande-porcine-francaise.json index f877d9e2ae821..e94f6ca12d31f 100644 --- a/tests/unit/expected_test_results/ecoscore/fr-viande-porcine-francaise.json +++ b/tests/unit/expected_test_results/ecoscore/fr-viande-porcine-francaise.json @@ -486,6 +486,7 @@ "en:egg", "en:salt" ], + "ingredients_lc" : "fr", "ingredients_n" : 4, "ingredients_n_tags" : [ "4", diff --git a/tests/unit/expected_test_results/ecoscore/fresh-vegetable.json b/tests/unit/expected_test_results/ecoscore/fresh-vegetable.json index ab341264d76d2..d8c499b455ed4 100644 --- a/tests/unit/expected_test_results/ecoscore/fresh-vegetable.json +++ b/tests/unit/expected_test_results/ecoscore/fresh-vegetable.json @@ -276,6 +276,7 @@ "en:vegetable", "en:fruit-vegetable" ], + "ingredients_lc" : "en", "ingredients_n" : 1, "ingredients_n_tags" : [ "1", diff --git a/tests/unit/expected_test_results/ecoscore/frozen-vegetable.json b/tests/unit/expected_test_results/ecoscore/frozen-vegetable.json index b906ef617e621..dd80ca4b50194 100644 --- a/tests/unit/expected_test_results/ecoscore/frozen-vegetable.json +++ b/tests/unit/expected_test_results/ecoscore/frozen-vegetable.json @@ -434,6 +434,7 @@ "en:root-vegetable", "en:taproot-vegetable" ], + "ingredients_lc" : "en", "ingredients_n" : 1, "ingredients_n_tags" : [ "1", diff --git a/tests/unit/expected_test_results/ecoscore/grade-a-with-non-recyclable-label.json b/tests/unit/expected_test_results/ecoscore/grade-a-with-non-recyclable-label.json index 74482ed72a619..0af548ae36664 100644 --- a/tests/unit/expected_test_results/ecoscore/grade-a-with-non-recyclable-label.json +++ b/tests/unit/expected_test_results/ecoscore/grade-a-with-non-recyclable-label.json @@ -478,6 +478,7 @@ "en:vegetable-oil-and-fat", "en:rapeseed-oil" ], + "ingredients_lc" : "fr", "ingredients_n" : 3, "ingredients_n_tags" : [ "3", diff --git a/tests/unit/expected_test_results/ecoscore/grade-a-with-recyclable-label.json b/tests/unit/expected_test_results/ecoscore/grade-a-with-recyclable-label.json index c11669e33ec8c..d3b85c46004dc 100644 --- a/tests/unit/expected_test_results/ecoscore/grade-a-with-recyclable-label.json +++ b/tests/unit/expected_test_results/ecoscore/grade-a-with-recyclable-label.json @@ -478,6 +478,7 @@ "en:vegetable-oil-and-fat", "en:rapeseed-oil" ], + "ingredients_lc" : "fr", "ingredients_n" : 3, "ingredients_n_tags" : [ "3", diff --git a/tests/unit/expected_test_results/ecoscore/lamb-leg.json b/tests/unit/expected_test_results/ecoscore/lamb-leg.json index 537c580396786..66b0f79b28f1a 100644 --- a/tests/unit/expected_test_results/ecoscore/lamb-leg.json +++ b/tests/unit/expected_test_results/ecoscore/lamb-leg.json @@ -427,6 +427,7 @@ "en:sheep", "en:lamb" ], + "ingredients_lc" : "en", "ingredients_n" : 1, "ingredients_n_tags" : [ "1", diff --git a/tests/unit/expected_test_results/ecoscore/milk.json b/tests/unit/expected_test_results/ecoscore/milk.json index a8835d786cd4b..67fc8ccfde32b 100644 --- a/tests/unit/expected_test_results/ecoscore/milk.json +++ b/tests/unit/expected_test_results/ecoscore/milk.json @@ -440,6 +440,7 @@ "en:milk", "en:dairy" ], + "ingredients_lc" : "fr", "ingredients_n" : 1, "ingredients_n_tags" : [ "1", diff --git a/tests/unit/expected_test_results/ecoscore/origins-of-ingredients-in-origins-field-multiple.json b/tests/unit/expected_test_results/ecoscore/origins-of-ingredients-in-origins-field-multiple.json index 08e13364b6ca0..d5166a5e58f9d 100644 --- a/tests/unit/expected_test_results/ecoscore/origins-of-ingredients-in-origins-field-multiple.json +++ b/tests/unit/expected_test_results/ecoscore/origins-of-ingredients-in-origins-field-multiple.json @@ -462,6 +462,7 @@ "en:juice", "en:fruit-juice" ], + "ingredients_lc" : "en", "ingredients_n" : 3, "ingredients_n_tags" : [ "3", diff --git a/tests/unit/expected_test_results/ecoscore/origins-of-ingredients-in-origins-field.json b/tests/unit/expected_test_results/ecoscore/origins-of-ingredients-in-origins-field.json index 279cccffba485..a6df523aabac7 100644 --- a/tests/unit/expected_test_results/ecoscore/origins-of-ingredients-in-origins-field.json +++ b/tests/unit/expected_test_results/ecoscore/origins-of-ingredients-in-origins-field.json @@ -457,6 +457,7 @@ "en:juice", "en:fruit-juice" ], + "ingredients_lc" : "en", "ingredients_n" : 3, "ingredients_n_tags" : [ "3", diff --git a/tests/unit/expected_test_results/ecoscore/origins-of-ingredients-nested-2.json b/tests/unit/expected_test_results/ecoscore/origins-of-ingredients-nested-2.json index f1b658fc74857..9959fa95a6bb8 100644 --- a/tests/unit/expected_test_results/ecoscore/origins-of-ingredients-nested-2.json +++ b/tests/unit/expected_test_results/ecoscore/origins-of-ingredients-nested-2.json @@ -497,6 +497,7 @@ "en:sweetener", "en:e951" ], + "ingredients_lc" : "en", "ingredients_n" : 7, "ingredients_n_tags" : [ "7", diff --git a/tests/unit/expected_test_results/ecoscore/origins-of-ingredients-nested.json b/tests/unit/expected_test_results/ecoscore/origins-of-ingredients-nested.json index 90efc35d6af6d..827dd2cc245ab 100644 --- a/tests/unit/expected_test_results/ecoscore/origins-of-ingredients-nested.json +++ b/tests/unit/expected_test_results/ecoscore/origins-of-ingredients-nested.json @@ -459,6 +459,7 @@ "en:colour", "en:e160b" ], + "ingredients_lc" : "en", "ingredients_n" : 4, "ingredients_n_tags" : [ "4", diff --git a/tests/unit/expected_test_results/ecoscore/origins-of-ingredients-not-specified.json b/tests/unit/expected_test_results/ecoscore/origins-of-ingredients-not-specified.json index ade5fa6ba6016..c4cba6790d9ad 100644 --- a/tests/unit/expected_test_results/ecoscore/origins-of-ingredients-not-specified.json +++ b/tests/unit/expected_test_results/ecoscore/origins-of-ingredients-not-specified.json @@ -454,6 +454,7 @@ "en:juice", "en:fruit-juice" ], + "ingredients_lc" : "en", "ingredients_n" : 3, "ingredients_n_tags" : [ "3", diff --git a/tests/unit/expected_test_results/ecoscore/origins-of-ingredients-partly-specified.json b/tests/unit/expected_test_results/ecoscore/origins-of-ingredients-partly-specified.json index 5a4426bbf9c62..e1ad030f81fa8 100644 --- a/tests/unit/expected_test_results/ecoscore/origins-of-ingredients-partly-specified.json +++ b/tests/unit/expected_test_results/ecoscore/origins-of-ingredients-partly-specified.json @@ -457,6 +457,7 @@ "en:juice", "en:fruit-juice" ], + "ingredients_lc" : "en", "ingredients_n" : 3, "ingredients_n_tags" : [ "3", diff --git a/tests/unit/expected_test_results/ecoscore/origins-of-ingredients-specified-multiple.json b/tests/unit/expected_test_results/ecoscore/origins-of-ingredients-specified-multiple.json index 1eb63dc019fe6..71cd7b658883d 100644 --- a/tests/unit/expected_test_results/ecoscore/origins-of-ingredients-specified-multiple.json +++ b/tests/unit/expected_test_results/ecoscore/origins-of-ingredients-specified-multiple.json @@ -474,6 +474,7 @@ "en:juice", "en:fruit-juice" ], + "ingredients_lc" : "en", "ingredients_n" : 3, "ingredients_n_tags" : [ "3", diff --git a/tests/unit/expected_test_results/ecoscore/origins-of-ingredients-specified.json b/tests/unit/expected_test_results/ecoscore/origins-of-ingredients-specified.json index e6f2a6df5dcd0..558d5dcc02210 100644 --- a/tests/unit/expected_test_results/ecoscore/origins-of-ingredients-specified.json +++ b/tests/unit/expected_test_results/ecoscore/origins-of-ingredients-specified.json @@ -463,6 +463,7 @@ "en:juice", "en:fruit-juice" ], + "ingredients_lc" : "en", "ingredients_n" : 3, "ingredients_n_tags" : [ "3", diff --git a/tests/unit/expected_test_results/ecoscore/origins-of-ingredients-unknown-origin.json b/tests/unit/expected_test_results/ecoscore/origins-of-ingredients-unknown-origin.json index f37060a9e499f..3bf979faada2a 100644 --- a/tests/unit/expected_test_results/ecoscore/origins-of-ingredients-unknown-origin.json +++ b/tests/unit/expected_test_results/ecoscore/origins-of-ingredients-unknown-origin.json @@ -426,6 +426,7 @@ "en:milk", "en:dairy" ], + "ingredients_lc" : "en", "ingredients_n" : 1, "ingredients_n_tags" : [ "1", diff --git a/tests/unit/expected_test_results/ecoscore/origins-of-ingredients-unspecified-origin.json b/tests/unit/expected_test_results/ecoscore/origins-of-ingredients-unspecified-origin.json index 5c60bac5998e4..b8b7230a64a1a 100644 --- a/tests/unit/expected_test_results/ecoscore/origins-of-ingredients-unspecified-origin.json +++ b/tests/unit/expected_test_results/ecoscore/origins-of-ingredients-unspecified-origin.json @@ -423,6 +423,7 @@ "en:milk", "en:dairy" ], + "ingredients_lc" : "en", "ingredients_n" : 1, "ingredients_n_tags" : [ "1", diff --git a/tests/unit/expected_test_results/ecoscore/packaging-fr-new-shapes.json b/tests/unit/expected_test_results/ecoscore/packaging-fr-new-shapes.json index b142934090131..132d77cb444f7 100644 --- a/tests/unit/expected_test_results/ecoscore/packaging-fr-new-shapes.json +++ b/tests/unit/expected_test_results/ecoscore/packaging-fr-new-shapes.json @@ -458,6 +458,7 @@ "en:wheat", "en:cereal" ], + "ingredients_lc" : "fr", "ingredients_n" : 1, "ingredients_n_tags" : [ "1", diff --git a/tests/unit/expected_test_results/ecoscore/packaging-unspecified-no-a-eco-score.json b/tests/unit/expected_test_results/ecoscore/packaging-unspecified-no-a-eco-score.json index ab193beac3405..0adccdfbbecb7 100644 --- a/tests/unit/expected_test_results/ecoscore/packaging-unspecified-no-a-eco-score.json +++ b/tests/unit/expected_test_results/ecoscore/packaging-unspecified-no-a-eco-score.json @@ -419,6 +419,7 @@ "en:wheat", "en:cereal" ], + "ingredients_lc" : "en", "ingredients_n" : 1, "ingredients_n_tags" : [ "1", diff --git a/tests/unit/expected_test_results/ecoscore/sum-of-bonuses-greater-than-25.json b/tests/unit/expected_test_results/ecoscore/sum-of-bonuses-greater-than-25.json index bc9d863c9c825..c3c545380c299 100644 --- a/tests/unit/expected_test_results/ecoscore/sum-of-bonuses-greater-than-25.json +++ b/tests/unit/expected_test_results/ecoscore/sum-of-bonuses-greater-than-25.json @@ -435,6 +435,7 @@ "en:chicken", "en:poultry" ], + "ingredients_lc" : "fr", "ingredients_n" : 1, "ingredients_n_tags" : [ "1", diff --git a/tests/unit/expected_test_results/ecoscore/track-ecoscore-changes.json b/tests/unit/expected_test_results/ecoscore/track-ecoscore-changes.json index 1c5e7050374b0..50fcc68f77525 100644 --- a/tests/unit/expected_test_results/ecoscore/track-ecoscore-changes.json +++ b/tests/unit/expected_test_results/ecoscore/track-ecoscore-changes.json @@ -451,6 +451,7 @@ "en:duck", "en:duck-liver" ], + "ingredients_lc" : "fr", "ingredients_n" : 1, "ingredients_n_tags" : [ "1", diff --git a/tests/unit/expected_test_results/ecoscore/track-ecoscore-no-change.json b/tests/unit/expected_test_results/ecoscore/track-ecoscore-no-change.json index b0a4d6ddd6410..915a95ea4d315 100644 --- a/tests/unit/expected_test_results/ecoscore/track-ecoscore-no-change.json +++ b/tests/unit/expected_test_results/ecoscore/track-ecoscore-no-change.json @@ -444,6 +444,7 @@ "en:duck", "en:duck-liver" ], + "ingredients_lc" : "fr", "ingredients_n" : 1, "ingredients_n_tags" : [ "1", diff --git a/tests/unit/expected_test_results/ecoscore/track-ecoscore-same-grade.json b/tests/unit/expected_test_results/ecoscore/track-ecoscore-same-grade.json index 8fe7ea6f2052b..1927d2688ecc8 100644 --- a/tests/unit/expected_test_results/ecoscore/track-ecoscore-same-grade.json +++ b/tests/unit/expected_test_results/ecoscore/track-ecoscore-same-grade.json @@ -451,6 +451,7 @@ "en:duck", "en:duck-liver" ], + "ingredients_lc" : "fr", "ingredients_n" : 1, "ingredients_n_tags" : [ "1", diff --git a/tests/unit/expected_test_results/ecoscore/track-ecoscore-tags-retained.json b/tests/unit/expected_test_results/ecoscore/track-ecoscore-tags-retained.json index 76f5bd566fb5f..1c9ee9054b22c 100644 --- a/tests/unit/expected_test_results/ecoscore/track-ecoscore-tags-retained.json +++ b/tests/unit/expected_test_results/ecoscore/track-ecoscore-tags-retained.json @@ -449,6 +449,7 @@ "en:duck", "en:duck-liver" ], + "ingredients_lc" : "fr", "ingredients_n" : 1, "ingredients_n_tags" : [ "1", diff --git a/tests/unit/expected_test_results/ecoscore/uk-milk.json b/tests/unit/expected_test_results/ecoscore/uk-milk.json index 6690f146a31b7..9897d99b1eb67 100644 --- a/tests/unit/expected_test_results/ecoscore/uk-milk.json +++ b/tests/unit/expected_test_results/ecoscore/uk-milk.json @@ -443,6 +443,7 @@ "en:milk", "en:dairy" ], + "ingredients_lc" : "en", "ingredients_n" : 1, "ingredients_n_tags" : [ "1", diff --git a/tests/unit/expected_test_results/forest_footprint/fr-ingredients-filet-de-poulet-bio-oeuf-label-rouge-os-de-poulet-igp.json b/tests/unit/expected_test_results/forest_footprint/fr-ingredients-filet-de-poulet-bio-oeuf-label-rouge-os-de-poulet-igp.json index 45b41f050df80..a86e9ece7851d 100644 --- a/tests/unit/expected_test_results/forest_footprint/fr-ingredients-filet-de-poulet-bio-oeuf-label-rouge-os-de-poulet-igp.json +++ b/tests/unit/expected_test_results/forest_footprint/fr-ingredients-filet-de-poulet-bio-oeuf-label-rouge-os-de-poulet-igp.json @@ -132,6 +132,7 @@ "en:chicken-bone", "en:bone" ], + "ingredients_lc" : "fr", "ingredients_n" : 3, "ingredients_n_tags" : [ "3", diff --git a/tests/unit/expected_test_results/forest_footprint/fr-ingredients-filet-de-poulet-bio.json b/tests/unit/expected_test_results/forest_footprint/fr-ingredients-filet-de-poulet-bio.json index fd5ab0e2235c3..4d56cc32dff7b 100644 --- a/tests/unit/expected_test_results/forest_footprint/fr-ingredients-filet-de-poulet-bio.json +++ b/tests/unit/expected_test_results/forest_footprint/fr-ingredients-filet-de-poulet-bio.json @@ -59,6 +59,7 @@ "en:chicken", "en:chicken-meat" ], + "ingredients_lc" : "fr", "ingredients_n" : 1, "ingredients_n_tags" : [ "1", diff --git a/tests/unit/expected_test_results/forest_footprint/fr-ingredients-lait.json b/tests/unit/expected_test_results/forest_footprint/fr-ingredients-lait.json index 3230bfd9455a8..e49382614d696 100644 --- a/tests/unit/expected_test_results/forest_footprint/fr-ingredients-lait.json +++ b/tests/unit/expected_test_results/forest_footprint/fr-ingredients-lait.json @@ -27,6 +27,7 @@ "en:milk", "en:dairy" ], + "ingredients_lc" : "fr", "ingredients_n" : 1, "ingredients_n_tags" : [ "1", diff --git a/tests/unit/expected_test_results/forest_footprint/fr-ingredients-nested-matching-ingredient.json b/tests/unit/expected_test_results/forest_footprint/fr-ingredients-nested-matching-ingredient.json index 6a65319f0c59f..e0bba1f843c2c 100644 --- a/tests/unit/expected_test_results/forest_footprint/fr-ingredients-nested-matching-ingredient.json +++ b/tests/unit/expected_test_results/forest_footprint/fr-ingredients-nested-matching-ingredient.json @@ -98,6 +98,7 @@ "en:water", "en:brine" ], + "ingredients_lc" : "fr", "ingredients_n" : 4, "ingredients_n_tags" : [ "4", diff --git a/tests/unit/expected_test_results/forest_footprint/fr-ingredients-nested-matching-sub-ingredient.json b/tests/unit/expected_test_results/forest_footprint/fr-ingredients-nested-matching-sub-ingredient.json index 68cf72ba0f44a..b8c2adb50b626 100644 --- a/tests/unit/expected_test_results/forest_footprint/fr-ingredients-nested-matching-sub-ingredient.json +++ b/tests/unit/expected_test_results/forest_footprint/fr-ingredients-nested-matching-sub-ingredient.json @@ -103,6 +103,7 @@ "en:water", "en:brine" ], + "ingredients_lc" : "fr", "ingredients_n" : 4, "ingredients_n_tags" : [ "4", diff --git a/tests/unit/expected_test_results/forest_footprint/fr-ingredients-poulet-du-gers.json b/tests/unit/expected_test_results/forest_footprint/fr-ingredients-poulet-du-gers.json index 61c3b04590925..a692099e61635 100644 --- a/tests/unit/expected_test_results/forest_footprint/fr-ingredients-poulet-du-gers.json +++ b/tests/unit/expected_test_results/forest_footprint/fr-ingredients-poulet-du-gers.json @@ -57,6 +57,7 @@ "en:chicken", "en:poultry" ], + "ingredients_lc" : "fr", "ingredients_n" : 1, "ingredients_n_tags" : [ "1", diff --git a/tests/unit/expected_test_results/forest_footprint/fr-ingredients-poulet.json b/tests/unit/expected_test_results/forest_footprint/fr-ingredients-poulet.json index aa906338d0766..0560663119576 100644 --- a/tests/unit/expected_test_results/forest_footprint/fr-ingredients-poulet.json +++ b/tests/unit/expected_test_results/forest_footprint/fr-ingredients-poulet.json @@ -51,6 +51,7 @@ "en:chicken", "en:poultry" ], + "ingredients_lc" : "fr", "ingredients_n" : 1, "ingredients_n_tags" : [ "1", diff --git a/tests/unit/expected_test_results/ingredients/ca-middle-dot.json b/tests/unit/expected_test_results/ingredients/ca-middle-dot.json index e51c9c66a16d8..c19929f99bfc0 100644 --- a/tests/unit/expected_test_results/ingredients/ca-middle-dot.json +++ b/tests/unit/expected_test_results/ingredients/ca-middle-dot.json @@ -110,6 +110,7 @@ "en:coagulating-enzyme", "en:e460" ], + "ingredients_lc" : "ca", "ingredients_n" : 7, "ingredients_n_tags" : [ "7", diff --git a/tests/unit/expected_test_results/ingredients/en-allergens-in-parenthesis.json b/tests/unit/expected_test_results/ingredients/en-allergens-in-parenthesis.json index 307d2643049eb..de76b66026f40 100644 --- a/tests/unit/expected_test_results/ingredients/en-allergens-in-parenthesis.json +++ b/tests/unit/expected_test_results/ingredients/en-allergens-in-parenthesis.json @@ -127,6 +127,7 @@ "en:salt", "en:water" ], + "ingredients_lc" : "en", "ingredients_n" : 8, "ingredients_n_tags" : [ "8", diff --git a/tests/unit/expected_test_results/ingredients/en-category-types.json b/tests/unit/expected_test_results/ingredients/en-category-types.json index 3c65885a49cb5..51183491e9574 100644 --- a/tests/unit/expected_test_results/ingredients/en-category-types.json +++ b/tests/unit/expected_test_results/ingredients/en-category-types.json @@ -70,6 +70,7 @@ "en:vegetable-fat", "en:sunflower-fat" ], + "ingredients_lc" : "de", "ingredients_n" : 4, "ingredients_n_tags" : [ "4", diff --git a/tests/unit/expected_test_results/ingredients/en-comma-and-pepper.json b/tests/unit/expected_test_results/ingredients/en-comma-and-pepper.json index fb4b4b44021b3..ab09ab5ae5be5 100644 --- a/tests/unit/expected_test_results/ingredients/en-comma-and-pepper.json +++ b/tests/unit/expected_test_results/ingredients/en-comma-and-pepper.json @@ -49,6 +49,7 @@ "en:pepper", "en:seed" ], + "ingredients_lc" : "en", "ingredients_n" : 3, "ingredients_n_tags" : [ "3", diff --git a/tests/unit/expected_test_results/ingredients/en-content-of-ingredient.json b/tests/unit/expected_test_results/ingredients/en-content-of-ingredient.json index 56de8a7940381..cb9b97e229783 100644 --- a/tests/unit/expected_test_results/ingredients/en-content-of-ingredient.json +++ b/tests/unit/expected_test_results/ingredients/en-content-of-ingredient.json @@ -1,6 +1,7 @@ { "ingredients" : [], "ingredients_hierarchy" : [], + "ingredients_lc" : "en", "ingredients_n" : 0, "ingredients_n_tags" : [ "0", diff --git a/tests/unit/expected_test_results/ingredients/en-emulsifier-synonyms.json b/tests/unit/expected_test_results/ingredients/en-emulsifier-synonyms.json index 23118fd8c557a..f0f4442060cf5 100644 --- a/tests/unit/expected_test_results/ingredients/en-emulsifier-synonyms.json +++ b/tests/unit/expected_test_results/ingredients/en-emulsifier-synonyms.json @@ -88,6 +88,7 @@ "en:e412", "en:e410" ], + "ingredients_lc" : "en", "ingredients_n" : 6, "ingredients_n_tags" : [ "6", diff --git a/tests/unit/expected_test_results/ingredients/en-flavour-synonyms.json b/tests/unit/expected_test_results/ingredients/en-flavour-synonyms.json index 0ac92aafa012a..a933d6068ce9a 100644 --- a/tests/unit/expected_test_results/ingredients/en-flavour-synonyms.json +++ b/tests/unit/expected_test_results/ingredients/en-flavour-synonyms.json @@ -42,6 +42,7 @@ "en:natural-flavouring", "en:lemon-flavouring" ], + "ingredients_lc" : "en", "ingredients_n" : 2, "ingredients_n_tags" : [ "2", diff --git a/tests/unit/expected_test_results/ingredients/en-fruits-sub-ingredients.json b/tests/unit/expected_test_results/ingredients/en-fruits-sub-ingredients.json index b87d495ca0187..39c32f18cece2 100644 --- a/tests/unit/expected_test_results/ingredients/en-fruits-sub-ingredients.json +++ b/tests/unit/expected_test_results/ingredients/en-fruits-sub-ingredients.json @@ -92,6 +92,7 @@ "en:lemon", "en:citrus-fruit" ], + "ingredients_lc" : "en", "ingredients_n" : 6, "ingredients_n_tags" : [ "6", diff --git a/tests/unit/expected_test_results/ingredients/en-illegal-division-by-zero.json b/tests/unit/expected_test_results/ingredients/en-illegal-division-by-zero.json index 02db941a5f05c..ecbdd92d0a660 100644 --- a/tests/unit/expected_test_results/ingredients/en-illegal-division-by-zero.json +++ b/tests/unit/expected_test_results/ingredients/en-illegal-division-by-zero.json @@ -44,6 +44,7 @@ "en:each-capsule-contains", "en:paracetamol-500-m-5-060198-790" ], + "ingredients_lc" : "en", "ingredients_n" : 2, "ingredients_n_tags" : [ "2", diff --git a/tests/unit/expected_test_results/ingredients/en-ing1-and-ing2-processing-parenthesis.json b/tests/unit/expected_test_results/ingredients/en-ing1-and-ing2-processing-parenthesis.json index 67e31b1fad811..fa3fca5ec9692 100644 --- a/tests/unit/expected_test_results/ingredients/en-ing1-and-ing2-processing-parenthesis.json +++ b/tests/unit/expected_test_results/ingredients/en-ing1-and-ing2-processing-parenthesis.json @@ -109,6 +109,7 @@ "en:taproot-vegetable", "en:radish" ], + "ingredients_lc" : "en", "ingredients_n" : 7, "ingredients_n_tags" : [ "7", diff --git a/tests/unit/expected_test_results/ingredients/en-ing1-and-ing2-processing.json b/tests/unit/expected_test_results/ingredients/en-ing1-and-ing2-processing.json index f4b012877d8ef..08a98b8e611f6 100644 --- a/tests/unit/expected_test_results/ingredients/en-ing1-and-ing2-processing.json +++ b/tests/unit/expected_test_results/ingredients/en-ing1-and-ing2-processing.json @@ -253,6 +253,7 @@ "en:orange", "en:caramelized-unknown-fruit4" ], + "ingredients_lc" : "en", "ingredients_n" : 18, "ingredients_n_tags" : [ "18", diff --git a/tests/unit/expected_test_results/ingredients/en-ingredient-content.json b/tests/unit/expected_test_results/ingredients/en-ingredient-content.json index 63c2cbb58972d..75e000b5c43e4 100644 --- a/tests/unit/expected_test_results/ingredients/en-ingredient-content.json +++ b/tests/unit/expected_test_results/ingredients/en-ingredient-content.json @@ -1,6 +1,7 @@ { "ingredients" : [], "ingredients_hierarchy" : [], + "ingredients_lc" : "en", "ingredients_n" : 0, "ingredients_n_tags" : [ "0", diff --git a/tests/unit/expected_test_results/ingredients/en-ingredients-analysis-unknown-ingredients.json b/tests/unit/expected_test_results/ingredients/en-ingredients-analysis-unknown-ingredients.json index 75b1872c31ed1..e51f22edcec5a 100644 --- a/tests/unit/expected_test_results/ingredients/en-ingredients-analysis-unknown-ingredients.json +++ b/tests/unit/expected_test_results/ingredients/en-ingredients-analysis-unknown-ingredients.json @@ -122,6 +122,7 @@ "en:condiment", "en:water" ], + "ingredients_lc" : "en", "ingredients_n" : 8, "ingredients_n_tags" : [ "8", diff --git a/tests/unit/expected_test_results/ingredients/en-ingredients-in-parenthesis-that-are-in-the-allergens-taxonomy.json b/tests/unit/expected_test_results/ingredients/en-ingredients-in-parenthesis-that-are-in-the-allergens-taxonomy.json index 5e41f24bbb82f..3ca47aaf62a1f 100644 --- a/tests/unit/expected_test_results/ingredients/en-ingredients-in-parenthesis-that-are-in-the-allergens-taxonomy.json +++ b/tests/unit/expected_test_results/ingredients/en-ingredients-in-parenthesis-that-are-in-the-allergens-taxonomy.json @@ -59,6 +59,7 @@ "en:cheese", "en:parmigiano-reggiano" ], + "ingredients_lc" : "en", "ingredients_n" : 3, "ingredients_n_tags" : [ "3", diff --git a/tests/unit/expected_test_results/ingredients/en-kosher.json b/tests/unit/expected_test_results/ingredients/en-kosher.json index d0a4be892442d..afa74278e1588 100644 --- a/tests/unit/expected_test_results/ingredients/en-kosher.json +++ b/tests/unit/expected_test_results/ingredients/en-kosher.json @@ -61,6 +61,7 @@ "en:beef", "en:e428" ], + "ingredients_lc" : "en", "ingredients_n" : 3, "ingredients_n_tags" : [ "3", diff --git a/tests/unit/expected_test_results/ingredients/en-mechanicaly-separated-meat.json b/tests/unit/expected_test_results/ingredients/en-mechanicaly-separated-meat.json index 34d7b1639fb02..db0050a5f7431 100644 --- a/tests/unit/expected_test_results/ingredients/en-mechanicaly-separated-meat.json +++ b/tests/unit/expected_test_results/ingredients/en-mechanicaly-separated-meat.json @@ -28,6 +28,7 @@ "ingredients_hierarchy" : [ "en:mechanicaly-separated-poultry-meat" ], + "ingredients_lc" : "en", "ingredients_n" : 1, "ingredients_n_tags" : [ "1", diff --git a/tests/unit/expected_test_results/ingredients/en-nova-4-fruit-juice-concentrates.json b/tests/unit/expected_test_results/ingredients/en-nova-4-fruit-juice-concentrates.json index aab9d69cb8074..d66bd449f6f6b 100644 --- a/tests/unit/expected_test_results/ingredients/en-nova-4-fruit-juice-concentrates.json +++ b/tests/unit/expected_test_results/ingredients/en-nova-4-fruit-juice-concentrates.json @@ -28,6 +28,7 @@ "en:apple", "en:fruit-juice" ], + "ingredients_lc" : "en", "ingredients_n" : 1, "ingredients_n_tags" : [ "1", diff --git a/tests/unit/expected_test_results/ingredients/en-origin-and.json b/tests/unit/expected_test_results/ingredients/en-origin-and.json index 82073a34c30f8..3284a7cac1168 100644 --- a/tests/unit/expected_test_results/ingredients/en-origin-and.json +++ b/tests/unit/expected_test_results/ingredients/en-origin-and.json @@ -25,6 +25,7 @@ "en:vegetable", "en:fruit-vegetable" ], + "ingredients_lc" : "en", "ingredients_n" : 1, "ingredients_n_tags" : [ "1", diff --git a/tests/unit/expected_test_results/ingredients/en-origin-field-with-commas-and.json b/tests/unit/expected_test_results/ingredients/en-origin-field-with-commas-and.json index 8d5b77028fcb0..e2ca0df192c5e 100644 --- a/tests/unit/expected_test_results/ingredients/en-origin-field-with-commas-and.json +++ b/tests/unit/expected_test_results/ingredients/en-origin-field-with-commas-and.json @@ -44,6 +44,7 @@ "en:added-sugar", "en:disaccharide" ], + "ingredients_lc" : "en", "ingredients_n" : 2, "ingredients_n_tags" : [ "2", diff --git a/tests/unit/expected_test_results/ingredients/en-origin-field-with-commas.json b/tests/unit/expected_test_results/ingredients/en-origin-field-with-commas.json index b125c498f8175..495c93990d0dc 100644 --- a/tests/unit/expected_test_results/ingredients/en-origin-field-with-commas.json +++ b/tests/unit/expected_test_results/ingredients/en-origin-field-with-commas.json @@ -43,6 +43,7 @@ "en:added-sugar", "en:disaccharide" ], + "ingredients_lc" : "en", "ingredients_n" : 2, "ingredients_n_tags" : [ "2", diff --git a/tests/unit/expected_test_results/ingredients/en-origin-field-with-not-taxonomized-entries.json b/tests/unit/expected_test_results/ingredients/en-origin-field-with-not-taxonomized-entries.json index 9d747d6d4a7d1..0c80853505930 100644 --- a/tests/unit/expected_test_results/ingredients/en-origin-field-with-not-taxonomized-entries.json +++ b/tests/unit/expected_test_results/ingredients/en-origin-field-with-not-taxonomized-entries.json @@ -57,6 +57,7 @@ "en:some-unknown-ingredient", "en:another-unknown-ingredient" ], + "ingredients_lc" : "en", "ingredients_n" : 3, "ingredients_n_tags" : [ "3", diff --git a/tests/unit/expected_test_results/ingredients/en-origin-field.json b/tests/unit/expected_test_results/ingredients/en-origin-field.json index 23b2b5b1a9d30..b8d4c8d82c2d9 100644 --- a/tests/unit/expected_test_results/ingredients/en-origin-field.json +++ b/tests/unit/expected_test_results/ingredients/en-origin-field.json @@ -96,6 +96,7 @@ "en:vegetable", "en:fruit-vegetable" ], + "ingredients_lc" : "en", "ingredients_n" : 6, "ingredients_n_tags" : [ "6", diff --git a/tests/unit/expected_test_results/ingredients/en-origin-ingredient-from-origin.json b/tests/unit/expected_test_results/ingredients/en-origin-ingredient-from-origin.json index f3d6e303ff464..15f2400fdc2d4 100644 --- a/tests/unit/expected_test_results/ingredients/en-origin-ingredient-from-origin.json +++ b/tests/unit/expected_test_results/ingredients/en-origin-ingredient-from-origin.json @@ -40,6 +40,7 @@ "en:bell-pepper", "en:yellow-bell-pepper" ], + "ingredients_lc" : "en", "ingredients_n" : 2, "ingredients_n_tags" : [ "2", diff --git a/tests/unit/expected_test_results/ingredients/en-origin-ingredient-origin-and-origin.json b/tests/unit/expected_test_results/ingredients/en-origin-ingredient-origin-and-origin.json index bb3eb43740871..09ba39fdba0a8 100644 --- a/tests/unit/expected_test_results/ingredients/en-origin-ingredient-origin-and-origin.json +++ b/tests/unit/expected_test_results/ingredients/en-origin-ingredient-origin-and-origin.json @@ -40,6 +40,7 @@ "en:bell-pepper", "en:yellow-bell-pepper" ], + "ingredients_lc" : "en", "ingredients_n" : 2, "ingredients_n_tags" : [ "2", diff --git a/tests/unit/expected_test_results/ingredients/en-origins-u.json b/tests/unit/expected_test_results/ingredients/en-origins-u.json index edc4d55a6d2ad..0a4e4e83ce313 100644 --- a/tests/unit/expected_test_results/ingredients/en-origins-u.json +++ b/tests/unit/expected_test_results/ingredients/en-origins-u.json @@ -42,6 +42,7 @@ "en:something", "en:u" ], + "ingredients_lc" : "en", "ingredients_n" : 2, "ingredients_n_tags" : [ "2", diff --git a/tests/unit/expected_test_results/ingredients/en-origins.json b/tests/unit/expected_test_results/ingredients/en-origins.json index 306731a616e40..8b2001a032cfd 100644 --- a/tests/unit/expected_test_results/ingredients/en-origins.json +++ b/tests/unit/expected_test_results/ingredients/en-origins.json @@ -103,6 +103,7 @@ "en:juice", "en:fruit-juice" ], + "ingredients_lc" : "en", "ingredients_n" : 6, "ingredients_n_tags" : [ "6", diff --git a/tests/unit/expected_test_results/ingredients/en-prepared-with.json b/tests/unit/expected_test_results/ingredients/en-prepared-with.json index b85e13b978af2..f7fa3cc77b3ed 100644 --- a/tests/unit/expected_test_results/ingredients/en-prepared-with.json +++ b/tests/unit/expected_test_results/ingredients/en-prepared-with.json @@ -1,6 +1,7 @@ { "ingredients" : [], "ingredients_hierarchy" : [], + "ingredients_lc" : "en", "ingredients_n" : 0, "ingredients_n_tags" : [ "0", diff --git a/tests/unit/expected_test_results/ingredients/en-quantity-of-ingredient.json b/tests/unit/expected_test_results/ingredients/en-quantity-of-ingredient.json index b65cd1fe74d52..50f8b2ca476ee 100644 --- a/tests/unit/expected_test_results/ingredients/en-quantity-of-ingredient.json +++ b/tests/unit/expected_test_results/ingredients/en-quantity-of-ingredient.json @@ -74,6 +74,7 @@ "en:oil-and-fat", "en:vegetable-oil-and-fat" ], + "ingredients_lc" : "en", "ingredients_n" : 4, "ingredients_n_tags" : [ "4", diff --git a/tests/unit/expected_test_results/ingredients/en-quantity-per-100g.json b/tests/unit/expected_test_results/ingredients/en-quantity-per-100g.json index 05df853fcb079..01a7ecbc6d524 100644 --- a/tests/unit/expected_test_results/ingredients/en-quantity-per-100g.json +++ b/tests/unit/expected_test_results/ingredients/en-quantity-per-100g.json @@ -45,6 +45,7 @@ "en:pork", "en:animal" ], + "ingredients_lc" : "en", "ingredients_n" : 2, "ingredients_n_tags" : [ "2", diff --git a/tests/unit/expected_test_results/ingredients/en-some-unknown-ingredient-and-salt.json b/tests/unit/expected_test_results/ingredients/en-some-unknown-ingredient-and-salt.json index dde39ee61041c..7d8cb434ff380 100644 --- a/tests/unit/expected_test_results/ingredients/en-some-unknown-ingredient-and-salt.json +++ b/tests/unit/expected_test_results/ingredients/en-some-unknown-ingredient-and-salt.json @@ -40,6 +40,7 @@ "en:some-unknown-ingredient", "en:salt" ], + "ingredients_lc" : "en", "ingredients_n" : 2, "ingredients_n_tags" : [ "2", diff --git a/tests/unit/expected_test_results/ingredients/en-specific-ingredients-multiple-strings-of-one-ingredient.json b/tests/unit/expected_test_results/ingredients/en-specific-ingredients-multiple-strings-of-one-ingredient.json index d8f90cab80ce1..a81525e693641 100644 --- a/tests/unit/expected_test_results/ingredients/en-specific-ingredients-multiple-strings-of-one-ingredient.json +++ b/tests/unit/expected_test_results/ingredients/en-specific-ingredients-multiple-strings-of-one-ingredient.json @@ -56,6 +56,7 @@ "en:added-sugar", "en:disaccharide" ], + "ingredients_lc" : "en", "ingredients_n" : 3, "ingredients_n_tags" : [ "3", diff --git a/tests/unit/expected_test_results/ingredients/en-specific-ingredients.json b/tests/unit/expected_test_results/ingredients/en-specific-ingredients.json index d0bd23fbb8d0c..096d038a2eeb5 100644 --- a/tests/unit/expected_test_results/ingredients/en-specific-ingredients.json +++ b/tests/unit/expected_test_results/ingredients/en-specific-ingredients.json @@ -55,6 +55,7 @@ "en:added-sugar", "en:disaccharide" ], + "ingredients_lc" : "en", "ingredients_n" : 3, "ingredients_n_tags" : [ "3", diff --git a/tests/unit/expected_test_results/ingredients/en-vegetal-ingredients.json b/tests/unit/expected_test_results/ingredients/en-vegetal-ingredients.json index 3e3bbf5da1c28..f24459e7050d0 100644 --- a/tests/unit/expected_test_results/ingredients/en-vegetal-ingredients.json +++ b/tests/unit/expected_test_results/ingredients/en-vegetal-ingredients.json @@ -75,6 +75,7 @@ "en:coagulating-enzyme", "en:flavouring" ], + "ingredients_lc" : "en", "ingredients_n" : 5, "ingredients_n_tags" : [ "5", diff --git a/tests/unit/expected_test_results/ingredients/en-vitamin.json b/tests/unit/expected_test_results/ingredients/en-vitamin.json index 50e9ea8fa886e..401d20f836d5a 100644 --- a/tests/unit/expected_test_results/ingredients/en-vitamin.json +++ b/tests/unit/expected_test_results/ingredients/en-vitamin.json @@ -33,6 +33,7 @@ "en:vitamins", "en:salt" ], + "ingredients_lc" : "en", "ingredients_n" : 2, "ingredients_n_tags" : [ "2", diff --git a/tests/unit/expected_test_results/ingredients/en-wheat-flour-organic-gluten-free.json b/tests/unit/expected_test_results/ingredients/en-wheat-flour-organic-gluten-free.json index ae9870794aae3..e89f53ed8185a 100644 --- a/tests/unit/expected_test_results/ingredients/en-wheat-flour-organic-gluten-free.json +++ b/tests/unit/expected_test_results/ingredients/en-wheat-flour-organic-gluten-free.json @@ -46,6 +46,7 @@ "en:cereal-flour", "en:fish" ], + "ingredients_lc" : "en", "ingredients_n" : 2, "ingredients_n_tags" : [ "2", diff --git a/tests/unit/expected_test_results/ingredients/es-percent-loop.json b/tests/unit/expected_test_results/ingredients/es-percent-loop.json index 4f587089a9eac..adc7b7475931d 100644 --- a/tests/unit/expected_test_results/ingredients/es-percent-loop.json +++ b/tests/unit/expected_test_results/ingredients/es-percent-loop.json @@ -172,6 +172,7 @@ "en:acid", "en:e330" ], + "ingredients_lc" : "es", "ingredients_n" : 11, "ingredients_n_tags" : [ "11", diff --git a/tests/unit/expected_test_results/ingredients/es-procedente-e-agricultura-biologica.json b/tests/unit/expected_test_results/ingredients/es-procedente-e-agricultura-biologica.json index ab38394057a07..014437204ac1b 100644 --- a/tests/unit/expected_test_results/ingredients/es-procedente-e-agricultura-biologica.json +++ b/tests/unit/expected_test_results/ingredients/es-procedente-e-agricultura-biologica.json @@ -47,6 +47,7 @@ "en:lactic-ferments", "en:kefir-ferments" ], + "ingredients_lc" : "es", "ingredients_n" : 2, "ingredients_n_tags" : [ "2", diff --git a/tests/unit/expected_test_results/ingredients/fi-additive.json b/tests/unit/expected_test_results/ingredients/fi-additive.json index 26e9892c0804e..f0c5b28bc8bc0 100644 --- a/tests/unit/expected_test_results/ingredients/fi-additive.json +++ b/tests/unit/expected_test_results/ingredients/fi-additive.json @@ -31,6 +31,7 @@ "en:gelling-agent", "en:e440a" ], + "ingredients_lc" : "fi", "ingredients_n" : 2, "ingredients_n_tags" : [ "2", diff --git a/tests/unit/expected_test_results/ingredients/fi-additives-origins.json b/tests/unit/expected_test_results/ingredients/fi-additives-origins.json index 5156924684181..6b453c6e77abd 100644 --- a/tests/unit/expected_test_results/ingredients/fi-additives-origins.json +++ b/tests/unit/expected_test_results/ingredients/fi-additives-origins.json @@ -86,6 +86,7 @@ "en:e322", "en:e322i" ], + "ingredients_lc" : "fi", "ingredients_n" : 5, "ingredients_n_tags" : [ "5", diff --git a/tests/unit/expected_test_results/ingredients/fi-additives-percents.json b/tests/unit/expected_test_results/ingredients/fi-additives-percents.json index a7a7d85556863..24f4172fe28a1 100644 --- a/tests/unit/expected_test_results/ingredients/fi-additives-percents.json +++ b/tests/unit/expected_test_results/ingredients/fi-additives-percents.json @@ -216,6 +216,7 @@ "en:e330", "en:e338" ], + "ingredients_lc" : "fi", "ingredients_n" : 19, "ingredients_n_tags" : [ "19", diff --git a/tests/unit/expected_test_results/ingredients/fi-do-not-match-myanmar.json b/tests/unit/expected_test_results/ingredients/fi-do-not-match-myanmar.json index c8874577395c7..69c43f6c63a7a 100644 --- a/tests/unit/expected_test_results/ingredients/fi-do-not-match-myanmar.json +++ b/tests/unit/expected_test_results/ingredients/fi-do-not-match-myanmar.json @@ -99,6 +99,7 @@ "en:mustard-seed", "en:mustard" ], + "ingredients_lc" : "fi", "ingredients_n" : 7, "ingredients_n_tags" : [ "7", diff --git a/tests/unit/expected_test_results/ingredients/fi-labels.json b/tests/unit/expected_test_results/ingredients/fi-labels.json index fae53fd37aabe..c5c4a29d2babe 100644 --- a/tests/unit/expected_test_results/ingredients/fi-labels.json +++ b/tests/unit/expected_test_results/ingredients/fi-labels.json @@ -50,6 +50,7 @@ "en:fish", "en:oily-fish" ], + "ingredients_lc" : "fi", "ingredients_n" : 2, "ingredients_n_tags" : [ "2", diff --git a/tests/unit/expected_test_results/ingredients/fi-organic-label-part-of-ingredient.json b/tests/unit/expected_test_results/ingredients/fi-organic-label-part-of-ingredient.json index 1a95480a35633..4901cac1dca51 100644 --- a/tests/unit/expected_test_results/ingredients/fi-organic-label-part-of-ingredient.json +++ b/tests/unit/expected_test_results/ingredients/fi-organic-label-part-of-ingredient.json @@ -57,6 +57,7 @@ "en:cereal", "en:malt" ], + "ingredients_lc" : "fi", "ingredients_n" : 3, "ingredients_n_tags" : [ "3", diff --git a/tests/unit/expected_test_results/ingredients/fi-origins.json b/tests/unit/expected_test_results/ingredients/fi-origins.json index eda4565d74e88..20d0104e62804 100644 --- a/tests/unit/expected_test_results/ingredients/fi-origins.json +++ b/tests/unit/expected_test_results/ingredients/fi-origins.json @@ -94,6 +94,7 @@ "en:plant", "en:cocoa-butter" ], + "ingredients_lc" : "fi", "ingredients_n" : 6, "ingredients_n_tags" : [ "6", diff --git a/tests/unit/expected_test_results/ingredients/fi-percents.json b/tests/unit/expected_test_results/ingredients/fi-percents.json index c629e47e5487c..98de2cb925927 100644 --- a/tests/unit/expected_test_results/ingredients/fi-percents.json +++ b/tests/unit/expected_test_results/ingredients/fi-percents.json @@ -55,6 +55,7 @@ "en:apple", "en:malaceous-fruit" ], + "ingredients_lc" : "fi", "ingredients_n" : 3, "ingredients_n_tags" : [ "3", diff --git a/tests/unit/expected_test_results/ingredients/fr-additive.json b/tests/unit/expected_test_results/ingredients/fr-additive.json index a29675332262c..26e5ef5749f01 100644 --- a/tests/unit/expected_test_results/ingredients/fr-additive.json +++ b/tests/unit/expected_test_results/ingredients/fr-additive.json @@ -31,6 +31,7 @@ "en:gelling-agent", "en:e440a" ], + "ingredients_lc" : "fr", "ingredients_n" : 2, "ingredients_n_tags" : [ "2", diff --git a/tests/unit/expected_test_results/ingredients/fr-cacao-issu-de-l-agriculture-biologique-de-madagascar.json b/tests/unit/expected_test_results/ingredients/fr-cacao-issu-de-l-agriculture-biologique-de-madagascar.json index 99f6c3c37bdfb..293675c34440b 100644 --- a/tests/unit/expected_test_results/ingredients/fr-cacao-issu-de-l-agriculture-biologique-de-madagascar.json +++ b/tests/unit/expected_test_results/ingredients/fr-cacao-issu-de-l-agriculture-biologique-de-madagascar.json @@ -24,6 +24,7 @@ "en:cocoa", "en:plant" ], + "ingredients_lc" : "fr", "ingredients_n" : 1, "ingredients_n_tags" : [ "1", diff --git a/tests/unit/expected_test_results/ingredients/fr-chocolate-cake.json b/tests/unit/expected_test_results/ingredients/fr-chocolate-cake.json index f85c6b224edc9..08cf7e2fe25e7 100644 --- a/tests/unit/expected_test_results/ingredients/fr-chocolate-cake.json +++ b/tests/unit/expected_test_results/ingredients/fr-chocolate-cake.json @@ -215,6 +215,7 @@ "en:e330", "en:e338" ], + "ingredients_lc" : "fr", "ingredients_n" : 19, "ingredients_n_tags" : [ "19", diff --git a/tests/unit/expected_test_results/ingredients/fr-content-of-ingredient.json b/tests/unit/expected_test_results/ingredients/fr-content-of-ingredient.json index 596589b2a5fe9..c063f6810ba89 100644 --- a/tests/unit/expected_test_results/ingredients/fr-content-of-ingredient.json +++ b/tests/unit/expected_test_results/ingredients/fr-content-of-ingredient.json @@ -1,6 +1,7 @@ { "ingredients" : [], "ingredients_hierarchy" : [], + "ingredients_lc" : "fr", "ingredients_n" : 0, "ingredients_n_tags" : [ "0", diff --git a/tests/unit/expected_test_results/ingredients/fr-epices-irradiees.json b/tests/unit/expected_test_results/ingredients/fr-epices-irradiees.json index 859ab71158b5b..38b83687d83d5 100644 --- a/tests/unit/expected_test_results/ingredients/fr-epices-irradiees.json +++ b/tests/unit/expected_test_results/ingredients/fr-epices-irradiees.json @@ -50,6 +50,7 @@ "en:thyme", "en:herb" ], + "ingredients_lc" : "fr", "ingredients_n" : 3, "ingredients_n_tags" : [ "3", diff --git a/tests/unit/expected_test_results/ingredients/fr-farines-labels-and-processes.json b/tests/unit/expected_test_results/ingredients/fr-farines-labels-and-processes.json index 08edc2e5781a5..e0a2900b99c34 100644 --- a/tests/unit/expected_test_results/ingredients/fr-farines-labels-and-processes.json +++ b/tests/unit/expected_test_results/ingredients/fr-farines-labels-and-processes.json @@ -66,6 +66,7 @@ "en:corn", "en:einkorn-wheat" ], + "ingredients_lc" : "fr", "ingredients_n" : 4, "ingredients_n_tags" : [ "4", diff --git a/tests/unit/expected_test_results/ingredients/fr-halal.json b/tests/unit/expected_test_results/ingredients/fr-halal.json index 73d4fdd64b059..762658ad2d8eb 100644 --- a/tests/unit/expected_test_results/ingredients/fr-halal.json +++ b/tests/unit/expected_test_results/ingredients/fr-halal.json @@ -77,6 +77,7 @@ "en:duck", "en:duck-liver" ], + "ingredients_lc" : "fr", "ingredients_n" : 4, "ingredients_n_tags" : [ "4", diff --git a/tests/unit/expected_test_results/ingredients/fr-huile-de-palme-certifiee-durable.json b/tests/unit/expected_test_results/ingredients/fr-huile-de-palme-certifiee-durable.json index 66addfdb464d6..5ac46a4e56b59 100644 --- a/tests/unit/expected_test_results/ingredients/fr-huile-de-palme-certifiee-durable.json +++ b/tests/unit/expected_test_results/ingredients/fr-huile-de-palme-certifiee-durable.json @@ -61,6 +61,7 @@ "en:colza-oil", "en:rapeseed-oil" ], + "ingredients_lc" : "fr", "ingredients_n" : 3, "ingredients_n_tags" : [ "3", diff --git a/tests/unit/expected_test_results/ingredients/fr-illegal-division-by-zero.json b/tests/unit/expected_test_results/ingredients/fr-illegal-division-by-zero.json index 5f0e6712e4d73..b0eb12d328bd7 100644 --- a/tests/unit/expected_test_results/ingredients/fr-illegal-division-by-zero.json +++ b/tests/unit/expected_test_results/ingredients/fr-illegal-division-by-zero.json @@ -44,6 +44,7 @@ "fr:analyse-moyenne-pour-1", "fr:1472-kj" ], + "ingredients_lc" : "fr", "ingredients_n" : 2, "ingredients_n_tags" : [ "2", diff --git a/tests/unit/expected_test_results/ingredients/fr-infinite-loop-allergens.json b/tests/unit/expected_test_results/ingredients/fr-infinite-loop-allergens.json index 89e5cb2288bbb..c366f98a9af43 100644 --- a/tests/unit/expected_test_results/ingredients/fr-infinite-loop-allergens.json +++ b/tests/unit/expected_test_results/ingredients/fr-infinite-loop-allergens.json @@ -159,6 +159,7 @@ "en:plant", "en:e322" ], + "ingredients_lc" : "fr", "ingredients_n" : 12, "ingredients_n_tags" : [ "12", diff --git a/tests/unit/expected_test_results/ingredients/fr-ingredients-in-parenthesis-that-are-in-the-allergens-taxonomy.json b/tests/unit/expected_test_results/ingredients/fr-ingredients-in-parenthesis-that-are-in-the-allergens-taxonomy.json index 81e258ce68c64..92f1f85bc94f8 100644 --- a/tests/unit/expected_test_results/ingredients/fr-ingredients-in-parenthesis-that-are-in-the-allergens-taxonomy.json +++ b/tests/unit/expected_test_results/ingredients/fr-ingredients-in-parenthesis-that-are-in-the-allergens-taxonomy.json @@ -59,6 +59,7 @@ "en:cheese", "en:parmigiano-reggiano" ], + "ingredients_lc" : "fr", "ingredients_n" : 3, "ingredients_n_tags" : [ "3", diff --git a/tests/unit/expected_test_results/ingredients/fr-label-and-multiple-origins.json b/tests/unit/expected_test_results/ingredients/fr-label-and-multiple-origins.json index 0d06335d554c0..c738bed3cc9f1 100644 --- a/tests/unit/expected_test_results/ingredients/fr-label-and-multiple-origins.json +++ b/tests/unit/expected_test_results/ingredients/fr-label-and-multiple-origins.json @@ -70,6 +70,7 @@ "fr:suisse", "fr:france" ], + "ingredients_lc" : "fr", "ingredients_n" : 4, "ingredients_n_tags" : [ "4", diff --git a/tests/unit/expected_test_results/ingredients/fr-labels.json b/tests/unit/expected_test_results/ingredients/fr-labels.json index ba8c323d7e08c..d51c20f1df5a5 100644 --- a/tests/unit/expected_test_results/ingredients/fr-labels.json +++ b/tests/unit/expected_test_results/ingredients/fr-labels.json @@ -50,6 +50,7 @@ "en:fish", "en:oily-fish" ], + "ingredients_lc" : "fr", "ingredients_n" : 2, "ingredients_n_tags" : [ "2", diff --git a/tests/unit/expected_test_results/ingredients/fr-legumes-issus-de-l-agriculture-durable.json b/tests/unit/expected_test_results/ingredients/fr-legumes-issus-de-l-agriculture-durable.json index 79c080335e3e7..c1c78f8eb153e 100644 --- a/tests/unit/expected_test_results/ingredients/fr-legumes-issus-de-l-agriculture-durable.json +++ b/tests/unit/expected_test_results/ingredients/fr-legumes-issus-de-l-agriculture-durable.json @@ -21,6 +21,7 @@ "ingredients_hierarchy" : [ "en:vegetable" ], + "ingredients_lc" : "fr", "ingredients_n" : 1, "ingredients_n_tags" : [ "1", diff --git a/tests/unit/expected_test_results/ingredients/fr-marmelade.json b/tests/unit/expected_test_results/ingredients/fr-marmelade.json index 4ff9f62c49373..5047b84e68f33 100644 --- a/tests/unit/expected_test_results/ingredients/fr-marmelade.json +++ b/tests/unit/expected_test_results/ingredients/fr-marmelade.json @@ -469,6 +469,7 @@ "en:sodium", "en:e415" ], + "ingredients_lc" : "fr", "ingredients_n" : 41, "ingredients_n_tags" : [ "41", diff --git a/tests/unit/expected_test_results/ingredients/fr-mechanicaly-separated-meat.json b/tests/unit/expected_test_results/ingredients/fr-mechanicaly-separated-meat.json index 1238276e63f7f..d70268669c8fc 100644 --- a/tests/unit/expected_test_results/ingredients/fr-mechanicaly-separated-meat.json +++ b/tests/unit/expected_test_results/ingredients/fr-mechanicaly-separated-meat.json @@ -67,6 +67,7 @@ "en:chicken", "en:chicken-meat" ], + "ingredients_lc" : "fr", "ingredients_n" : 3, "ingredients_n_tags" : [ "3", diff --git a/tests/unit/expected_test_results/ingredients/fr-oignon-francais-tomate-francaise.json b/tests/unit/expected_test_results/ingredients/fr-oignon-francais-tomate-francaise.json index 567a27737e667..8ce83973dad55 100644 --- a/tests/unit/expected_test_results/ingredients/fr-oignon-francais-tomate-francaise.json +++ b/tests/unit/expected_test_results/ingredients/fr-oignon-francais-tomate-francaise.json @@ -40,6 +40,7 @@ "fr:oignon-francais", "fr:tomate-francaise" ], + "ingredients_lc" : "fr", "ingredients_n" : 2, "ingredients_n_tags" : [ "2", diff --git a/tests/unit/expected_test_results/ingredients/fr-origin-and.json b/tests/unit/expected_test_results/ingredients/fr-origin-and.json index 712a26ba4e83f..b2eec2bda4fd0 100644 --- a/tests/unit/expected_test_results/ingredients/fr-origin-and.json +++ b/tests/unit/expected_test_results/ingredients/fr-origin-and.json @@ -26,6 +26,7 @@ "en:root-vegetable", "en:tuber" ], + "ingredients_lc" : "fr", "ingredients_n" : 1, "ingredients_n_tags" : [ "1", diff --git a/tests/unit/expected_test_results/ingredients/fr-origin-field.json b/tests/unit/expected_test_results/ingredients/fr-origin-field.json index 861949fca1569..bd925388dcffa 100644 --- a/tests/unit/expected_test_results/ingredients/fr-origin-field.json +++ b/tests/unit/expected_test_results/ingredients/fr-origin-field.json @@ -170,6 +170,7 @@ "en:pepper", "en:seed" ], + "ingredients_lc" : "fr", "ingredients_n" : 11, "ingredients_n_tags" : [ "11", diff --git a/tests/unit/expected_test_results/ingredients/fr-origin-ingredient-origin-and-origin.json b/tests/unit/expected_test_results/ingredients/fr-origin-ingredient-origin-and-origin.json index 9b08a98c898a8..d36f75eefc667 100644 --- a/tests/unit/expected_test_results/ingredients/fr-origin-ingredient-origin-and-origin.json +++ b/tests/unit/expected_test_results/ingredients/fr-origin-ingredient-origin-and-origin.json @@ -196,6 +196,7 @@ "en:finegrained-salt", "en:salt" ], + "ingredients_lc" : "fr", "ingredients_n" : 13, "ingredients_n_tags" : [ "13", diff --git a/tests/unit/expected_test_results/ingredients/fr-origins-agriculture-ue-non-ue.json b/tests/unit/expected_test_results/ingredients/fr-origins-agriculture-ue-non-ue.json index 643757fda2656..a50bf13cf36ec 100644 --- a/tests/unit/expected_test_results/ingredients/fr-origins-agriculture-ue-non-ue.json +++ b/tests/unit/expected_test_results/ingredients/fr-origins-agriculture-ue-non-ue.json @@ -25,6 +25,7 @@ "en:fruit", "en:berries" ], + "ingredients_lc" : "fr", "ingredients_n" : 1, "ingredients_n_tags" : [ "1", diff --git a/tests/unit/expected_test_results/ingredients/fr-origins-emmental-allemagne-france-pays-bas-contient-lait.json b/tests/unit/expected_test_results/ingredients/fr-origins-emmental-allemagne-france-pays-bas-contient-lait.json index 7f6673f0fcfee..9f665c22f84b6 100644 --- a/tests/unit/expected_test_results/ingredients/fr-origins-emmental-allemagne-france-pays-bas-contient-lait.json +++ b/tests/unit/expected_test_results/ingredients/fr-origins-emmental-allemagne-france-pays-bas-contient-lait.json @@ -32,6 +32,7 @@ "en:dairy", "en:cheese" ], + "ingredients_lc" : "fr", "ingredients_n" : 1, "ingredients_n_tags" : [ "1", diff --git a/tests/unit/expected_test_results/ingredients/fr-origins-labels.json b/tests/unit/expected_test_results/ingredients/fr-origins-labels.json index 5ccd5a1daa800..dabf63a5b23ed 100644 --- a/tests/unit/expected_test_results/ingredients/fr-origins-labels.json +++ b/tests/unit/expected_test_results/ingredients/fr-origins-labels.json @@ -136,6 +136,7 @@ "en:cherry", "en:prunus-species-fruit" ], + "ingredients_lc" : "fr", "ingredients_n" : 9, "ingredients_n_tags" : [ "9", diff --git a/tests/unit/expected_test_results/ingredients/fr-origins.json b/tests/unit/expected_test_results/ingredients/fr-origins.json index 34e672582e1d8..5b7ecb7ce62cc 100644 --- a/tests/unit/expected_test_results/ingredients/fr-origins.json +++ b/tests/unit/expected_test_results/ingredients/fr-origins.json @@ -77,6 +77,7 @@ "en:apple", "en:malaceous-fruit" ], + "ingredients_lc" : "fr", "ingredients_n" : 4, "ingredients_n_tags" : [ "4", diff --git a/tests/unit/expected_test_results/ingredients/fr-palm-kernel-fat.json b/tests/unit/expected_test_results/ingredients/fr-palm-kernel-fat.json index 4faf69adf625b..1006d69f7e4f2 100644 --- a/tests/unit/expected_test_results/ingredients/fr-palm-kernel-fat.json +++ b/tests/unit/expected_test_results/ingredients/fr-palm-kernel-fat.json @@ -28,6 +28,7 @@ "en:vegetable-oil-and-fat", "en:palm-kernel-oil-and-fat" ], + "ingredients_lc" : "fr", "ingredients_n" : 1, "ingredients_n_tags" : [ "1", diff --git a/tests/unit/expected_test_results/ingredients/fr-percents-origins-2.json b/tests/unit/expected_test_results/ingredients/fr-percents-origins-2.json index 8cccd422a7caa..6d872cdc35027 100644 --- a/tests/unit/expected_test_results/ingredients/fr-percents-origins-2.json +++ b/tests/unit/expected_test_results/ingredients/fr-percents-origins-2.json @@ -93,6 +93,7 @@ "en:e322", "en:e322i" ], + "ingredients_lc" : "fr", "ingredients_n" : 6, "ingredients_n_tags" : [ "6", diff --git a/tests/unit/expected_test_results/ingredients/fr-percents-origins.json b/tests/unit/expected_test_results/ingredients/fr-percents-origins.json index 50a542f50d7d9..59141c1c16bb5 100644 --- a/tests/unit/expected_test_results/ingredients/fr-percents-origins.json +++ b/tests/unit/expected_test_results/ingredients/fr-percents-origins.json @@ -67,6 +67,7 @@ "en:minerals", "en:sodium" ], + "ingredients_lc" : "fr", "ingredients_n" : 4, "ingredients_n_tags" : [ "4", diff --git a/tests/unit/expected_test_results/ingredients/fr-percents.json b/tests/unit/expected_test_results/ingredients/fr-percents.json index daa7c130c6e76..3ef2f4b6bdd28 100644 --- a/tests/unit/expected_test_results/ingredients/fr-percents.json +++ b/tests/unit/expected_test_results/ingredients/fr-percents.json @@ -55,6 +55,7 @@ "en:apple", "en:malaceous-fruit" ], + "ingredients_lc" : "fr", "ingredients_n" : 3, "ingredients_n_tags" : [ "3", diff --git a/tests/unit/expected_test_results/ingredients/fr-prepared-with.json b/tests/unit/expected_test_results/ingredients/fr-prepared-with.json index 9f626574a4c07..1f813aa989778 100644 --- a/tests/unit/expected_test_results/ingredients/fr-prepared-with.json +++ b/tests/unit/expected_test_results/ingredients/fr-prepared-with.json @@ -1,6 +1,7 @@ { "ingredients" : [], "ingredients_hierarchy" : [], + "ingredients_lc" : "fr", "ingredients_n" : 0, "ingredients_n_tags" : [ "0", diff --git a/tests/unit/expected_test_results/ingredients/fr-processing-multi.json b/tests/unit/expected_test_results/ingredients/fr-processing-multi.json index 8ea6929dcd11e..372d68c07d70e 100644 --- a/tests/unit/expected_test_results/ingredients/fr-processing-multi.json +++ b/tests/unit/expected_test_results/ingredients/fr-processing-multi.json @@ -111,6 +111,7 @@ "en:pork-meat", "en:ham" ], + "ingredients_lc" : "fr", "ingredients_n" : 6, "ingredients_n_tags" : [ "6", diff --git a/tests/unit/expected_test_results/ingredients/fr-quantity-of-ingredient.json b/tests/unit/expected_test_results/ingredients/fr-quantity-of-ingredient.json index c24c5b658c20a..671cd898644ef 100644 --- a/tests/unit/expected_test_results/ingredients/fr-quantity-of-ingredient.json +++ b/tests/unit/expected_test_results/ingredients/fr-quantity-of-ingredient.json @@ -75,6 +75,7 @@ "en:vegetable-oil-and-fat", "en:rapeseed-oil" ], + "ingredients_lc" : "fr", "ingredients_n" : 4, "ingredients_n_tags" : [ "4", diff --git a/tests/unit/expected_test_results/ingredients/fr-quantity-per-100g.json b/tests/unit/expected_test_results/ingredients/fr-quantity-per-100g.json index c3854d70472d0..c6659fa40a495 100644 --- a/tests/unit/expected_test_results/ingredients/fr-quantity-per-100g.json +++ b/tests/unit/expected_test_results/ingredients/fr-quantity-per-100g.json @@ -45,6 +45,7 @@ "en:pork", "en:animal" ], + "ingredients_lc" : "fr", "ingredients_n" : 2, "ingredients_n_tags" : [ "2", diff --git a/tests/unit/expected_test_results/ingredients/fr-semi.json b/tests/unit/expected_test_results/ingredients/fr-semi.json index d611cc94a973a..0a3854eb48f0e 100644 --- a/tests/unit/expected_test_results/ingredients/fr-semi.json +++ b/tests/unit/expected_test_results/ingredients/fr-semi.json @@ -43,6 +43,7 @@ "en:wheat", "en:wheat-flour" ], + "ingredients_lc" : "fr", "ingredients_n" : 2, "ingredients_n_tags" : [ "2", diff --git a/tests/unit/expected_test_results/ingredients/fr-specific-ingredients.json b/tests/unit/expected_test_results/ingredients/fr-specific-ingredients.json index bedb0e26529dc..cab45e4e086d4 100644 --- a/tests/unit/expected_test_results/ingredients/fr-specific-ingredients.json +++ b/tests/unit/expected_test_results/ingredients/fr-specific-ingredients.json @@ -82,6 +82,7 @@ "en:fruit-pectin", "en:e440a" ], + "ingredients_lc" : "fr", "ingredients_n" : 5, "ingredients_n_tags" : [ "5", diff --git a/tests/unit/expected_test_results/ingredients/fr-starred-label.json b/tests/unit/expected_test_results/ingredients/fr-starred-label.json index 82444424302ea..f383b2db3a7a9 100644 --- a/tests/unit/expected_test_results/ingredients/fr-starred-label.json +++ b/tests/unit/expected_test_results/ingredients/fr-starred-label.json @@ -56,6 +56,7 @@ "en:sugar", "en:cocoa-butter" ], + "ingredients_lc" : "fr", "ingredients_n" : 3, "ingredients_n_tags" : [ "3", diff --git a/tests/unit/expected_test_results/ingredients/fr-truncated-puree.json b/tests/unit/expected_test_results/ingredients/fr-truncated-puree.json index 2732bef51a159..1a421a2d8f006 100644 --- a/tests/unit/expected_test_results/ingredients/fr-truncated-puree.json +++ b/tests/unit/expected_test_results/ingredients/fr-truncated-puree.json @@ -69,6 +69,7 @@ "en:juice", "en:oil-and-fat" ], + "ingredients_lc" : "fr", "ingredients_n" : 4, "ingredients_n_tags" : [ "4", diff --git a/tests/unit/expected_test_results/ingredients/fr-vegetal-origin.json b/tests/unit/expected_test_results/ingredients/fr-vegetal-origin.json index c4ca1318d47b6..740574b726c31 100644 --- a/tests/unit/expected_test_results/ingredients/fr-vegetal-origin.json +++ b/tests/unit/expected_test_results/ingredients/fr-vegetal-origin.json @@ -50,6 +50,7 @@ "en:oil-and-fat", "en:e428" ], + "ingredients_lc" : "fr", "ingredients_n" : 3, "ingredients_n_tags" : [ "3", diff --git a/tests/unit/expected_test_results/ingredients/fr-viande-de-boeuf-issue-d-animaux-nourris-sans-ogm.json b/tests/unit/expected_test_results/ingredients/fr-viande-de-boeuf-issue-d-animaux-nourris-sans-ogm.json index 5592f28f6e7d4..c1751ecb522f1 100644 --- a/tests/unit/expected_test_results/ingredients/fr-viande-de-boeuf-issue-d-animaux-nourris-sans-ogm.json +++ b/tests/unit/expected_test_results/ingredients/fr-viande-de-boeuf-issue-d-animaux-nourris-sans-ogm.json @@ -32,6 +32,7 @@ "en:meat", "en:beef" ], + "ingredients_lc" : "fr", "ingredients_n" : 1, "ingredients_n_tags" : [ "1", diff --git a/tests/unit/expected_test_results/ingredients/fr-viande-porcine-francaise.json b/tests/unit/expected_test_results/ingredients/fr-viande-porcine-francaise.json index d7b8dde32ca4f..3e8638b4db1ef 100644 --- a/tests/unit/expected_test_results/ingredients/fr-viande-porcine-francaise.json +++ b/tests/unit/expected_test_results/ingredients/fr-viande-porcine-francaise.json @@ -79,6 +79,7 @@ "en:egg", "en:salt" ], + "ingredients_lc" : "fr", "ingredients_n" : 4, "ingredients_n_tags" : [ "4", diff --git a/tests/unit/expected_test_results/ingredients/ja-additives.json b/tests/unit/expected_test_results/ingredients/ja-additives.json index 569da06f39937..63577d0eea8be 100644 --- a/tests/unit/expected_test_results/ingredients/ja-additives.json +++ b/tests/unit/expected_test_results/ingredients/ja-additives.json @@ -176,6 +176,7 @@ "en:vitamin-e", "en:vegetable-pigment" ], + "ingredients_lc" : "ja", "ingredients_n" : 14, "ingredients_n_tags" : [ "14", diff --git a/tests/unit/expected_test_results/ingredients/ja-allergens-in-parenthesis.json b/tests/unit/expected_test_results/ingredients/ja-allergens-in-parenthesis.json index a8669e59f749a..51fd9d4162aef 100644 --- a/tests/unit/expected_test_results/ingredients/ja-allergens-in-parenthesis.json +++ b/tests/unit/expected_test_results/ingredients/ja-allergens-in-parenthesis.json @@ -65,6 +65,7 @@ "en:nut", "en:fish" ], + "ingredients_lc" : "ja", "ingredients_n" : 4, "ingredients_n_tags" : [ "4", diff --git a/tests/unit/expected_test_results/ingredients/ja-origin-and.json b/tests/unit/expected_test_results/ingredients/ja-origin-and.json index c9726b2b18641..7112572c5c16a 100644 --- a/tests/unit/expected_test_results/ingredients/ja-origin-and.json +++ b/tests/unit/expected_test_results/ingredients/ja-origin-and.json @@ -45,6 +45,7 @@ "en:fruit-vegetable", "ja:ときがわ町" ], + "ingredients_lc" : "ja", "ingredients_n" : 2, "ingredients_n_tags" : [ "2", diff --git a/tests/unit/expected_test_results/ingredients/ja-origins.json b/tests/unit/expected_test_results/ingredients/ja-origins.json index 5ba5d43d08c7a..921063798f844 100644 --- a/tests/unit/expected_test_results/ingredients/ja-origins.json +++ b/tests/unit/expected_test_results/ingredients/ja-origins.json @@ -181,6 +181,7 @@ "en:clementine", "en:citrus-fruit" ], + "ingredients_lc" : "ja", "ingredients_n" : 11, "ingredients_n_tags" : [ "11", diff --git a/tests/unit/expected_test_results/ingredients/ja-parenthesis.json b/tests/unit/expected_test_results/ingredients/ja-parenthesis.json index 2a4040805abe3..f469a9ecb2659 100644 --- a/tests/unit/expected_test_results/ingredients/ja-parenthesis.json +++ b/tests/unit/expected_test_results/ingredients/ja-parenthesis.json @@ -218,6 +218,7 @@ "en:glucose-syrup", "en:amino-acids" ], + "ingredients_lc" : "ja", "ingredients_n" : 15, "ingredients_n_tags" : [ "15", diff --git a/tests/unit/expected_test_results/ingredients/ja-slash.json b/tests/unit/expected_test_results/ingredients/ja-slash.json index 0c1a8de6a78ee..973a070cced53 100644 --- a/tests/unit/expected_test_results/ingredients/ja-slash.json +++ b/tests/unit/expected_test_results/ingredients/ja-slash.json @@ -211,6 +211,7 @@ "en:raising-agent", "en:flavouring" ], + "ingredients_lc" : "ja", "ingredients_n" : 15, "ingredients_n_tags" : [ "15", diff --git a/tests/unit/expected_test_results/ingredients/nl-e471-niet-dierlijk.json b/tests/unit/expected_test_results/ingredients/nl-e471-niet-dierlijk.json index 347828f8e04dc..a078e3ded5b4c 100644 --- a/tests/unit/expected_test_results/ingredients/nl-e471-niet-dierlijk.json +++ b/tests/unit/expected_test_results/ingredients/nl-e471-niet-dierlijk.json @@ -26,6 +26,7 @@ "ingredients_hierarchy" : [ "en:e471" ], + "ingredients_lc" : "nl", "ingredients_n" : 1, "ingredients_n_tags" : [ "1", diff --git a/tests/unit/expected_test_results/ingredients/ru-russian-oil.json b/tests/unit/expected_test_results/ingredients/ru-russian-oil.json index 1c00c37bfe2c7..736d4c1a513e0 100644 --- a/tests/unit/expected_test_results/ingredients/ru-russian-oil.json +++ b/tests/unit/expected_test_results/ingredients/ru-russian-oil.json @@ -51,6 +51,7 @@ "en:vegetable-oil", "en:soya-oil" ], + "ingredients_lc" : "ru", "ingredients_n" : 3, "ingredients_n_tags" : [ "3", diff --git a/tests/unit/expected_test_results/ingredients/xx-single-letters.json b/tests/unit/expected_test_results/ingredients/xx-single-letters.json index cf18a1f04ab06..9a44179a0b564 100644 --- a/tests/unit/expected_test_results/ingredients/xx-single-letters.json +++ b/tests/unit/expected_test_results/ingredients/xx-single-letters.json @@ -467,6 +467,7 @@ "fr:something", "fr:somethingelse" ], + "ingredients_lc" : "fr", "ingredients_n" : 37, "ingredients_n_tags" : [ "37", diff --git a/tests/unit/expected_test_results/ingredients_contents/fruits-water-sugar.json b/tests/unit/expected_test_results/ingredients_contents/fruits-water-sugar.json index 8694a8e6eec93..91d09320475f4 100644 --- a/tests/unit/expected_test_results/ingredients_contents/fruits-water-sugar.json +++ b/tests/unit/expected_test_results/ingredients_contents/fruits-water-sugar.json @@ -84,6 +84,7 @@ "en:added-sugar", "en:disaccharide" ], + "ingredients_lc" : "en", "ingredients_n" : 5, "ingredients_n_tags" : [ "5", diff --git a/tests/unit/expected_test_results/ingredients_contents/vegetable-oils.json b/tests/unit/expected_test_results/ingredients_contents/vegetable-oils.json index 336c8128f4ee2..fdbf036362854 100644 --- a/tests/unit/expected_test_results/ingredients_contents/vegetable-oils.json +++ b/tests/unit/expected_test_results/ingredients_contents/vegetable-oils.json @@ -71,6 +71,7 @@ "en:sunflower-oil", "en:walnut-oil" ], + "ingredients_lc" : "en", "ingredients_n" : 4, "ingredients_n_tags" : [ "4", diff --git a/tests/unit/expected_test_results/nutriscore/breakfast-cereals.json b/tests/unit/expected_test_results/nutriscore/breakfast-cereals.json index 64843df452163..ea0e6e5e63138 100644 --- a/tests/unit/expected_test_results/nutriscore/breakfast-cereals.json +++ b/tests/unit/expected_test_results/nutriscore/breakfast-cereals.json @@ -42,7 +42,6 @@ "en:cereals-and-potatoes", "en:breakfast-cereals" ], - "ingredients_lc" : "en", "lc" : "en", "misc_tags" : [ "en:nutriscore-computed", diff --git a/tests/unit/expected_test_results/nutriscore/cocoa-and-chocolate-powders.json b/tests/unit/expected_test_results/nutriscore/cocoa-and-chocolate-powders.json index 7032f72a8753f..8f65f58acd021 100644 --- a/tests/unit/expected_test_results/nutriscore/cocoa-and-chocolate-powders.json +++ b/tests/unit/expected_test_results/nutriscore/cocoa-and-chocolate-powders.json @@ -41,7 +41,6 @@ "improvements_tags" : [ "en:better-nutri-score-with-less-saturated-fat" ], - "ingredients_lc" : "en", "lc" : "en", "misc_tags" : [ "en:nutrition-grade-computed-for-prepared-product", diff --git a/tests/unit/expected_test_results/nutriscore/colza-oil.json b/tests/unit/expected_test_results/nutriscore/colza-oil.json index caecc02e9af56..72c367e73472e 100644 --- a/tests/unit/expected_test_results/nutriscore/colza-oil.json +++ b/tests/unit/expected_test_results/nutriscore/colza-oil.json @@ -42,7 +42,6 @@ "en:fats-and-sauces", "en:fats" ], - "ingredients_lc" : "en", "lc" : "en", "misc_tags" : [ "en:nutriscore-computed", diff --git a/tests/unit/expected_test_results/nutriscore/cookies.json b/tests/unit/expected_test_results/nutriscore/cookies.json index bd2438ea3a648..7a280b5434887 100644 --- a/tests/unit/expected_test_results/nutriscore/cookies.json +++ b/tests/unit/expected_test_results/nutriscore/cookies.json @@ -38,7 +38,6 @@ "en:sugary-snacks", "en:biscuits-and-cakes" ], - "ingredients_lc" : "en", "lc" : "en", "misc_tags" : [ "en:nutriscore-computed", diff --git a/tests/unit/expected_test_results/nutriscore/en-beers-category.json b/tests/unit/expected_test_results/nutriscore/en-beers-category.json index 7624669847149..a20568321d8fe 100644 --- a/tests/unit/expected_test_results/nutriscore/en-beers-category.json +++ b/tests/unit/expected_test_results/nutriscore/en-beers-category.json @@ -35,7 +35,6 @@ "food_groups_tags" : [ "en:alcoholic-beverages" ], - "ingredients_lc" : "en", "lc" : "en", "misc_tags" : [ "en:nutriscore-not-applicable", diff --git a/tests/unit/expected_test_results/nutriscore/en-milk.json b/tests/unit/expected_test_results/nutriscore/en-milk.json index 278a84d0a9469..2461ca0da629b 100644 --- a/tests/unit/expected_test_results/nutriscore/en-milk.json +++ b/tests/unit/expected_test_results/nutriscore/en-milk.json @@ -34,7 +34,6 @@ "en:milk-and-dairy-products", "en:milk-and-yogurt" ], - "ingredients_lc" : "en", "lc" : "en", "misc_tags" : [ "en:nutrition-no-fiber", diff --git a/tests/unit/expected_test_results/nutriscore/en-olive-oil-no-ingredients.json b/tests/unit/expected_test_results/nutriscore/en-olive-oil-no-ingredients.json index c2ce024c9f96f..df8254b0c29b8 100644 --- a/tests/unit/expected_test_results/nutriscore/en-olive-oil-no-ingredients.json +++ b/tests/unit/expected_test_results/nutriscore/en-olive-oil-no-ingredients.json @@ -44,7 +44,6 @@ "en:fats-and-sauces", "en:fats" ], - "ingredients_lc" : "en", "lc" : "en", "misc_tags" : [ "en:nutriscore-computed", diff --git a/tests/unit/expected_test_results/nutriscore/en-orange-juice-category.json b/tests/unit/expected_test_results/nutriscore/en-orange-juice-category.json index 2eed716c0dc32..39973e3122959 100644 --- a/tests/unit/expected_test_results/nutriscore/en-orange-juice-category.json +++ b/tests/unit/expected_test_results/nutriscore/en-orange-juice-category.json @@ -46,7 +46,6 @@ "en:beverages", "en:fruit-juices" ], - "ingredients_lc" : "en", "lc" : "en", "misc_tags" : [ "en:nutriscore-computed", diff --git a/tests/unit/expected_test_results/nutriscore/en-potatoes-category.json b/tests/unit/expected_test_results/nutriscore/en-potatoes-category.json index 876aa2dde1c75..866aa8002569c 100644 --- a/tests/unit/expected_test_results/nutriscore/en-potatoes-category.json +++ b/tests/unit/expected_test_results/nutriscore/en-potatoes-category.json @@ -42,7 +42,6 @@ "en:cereals-and-potatoes", "en:potatoes" ], - "ingredients_lc" : "en", "lc" : "en", "misc_tags" : [ "en:nutriscore-computed", diff --git a/tests/unit/expected_test_results/nutriscore/en-red-meat-ambiguous-category-no-ingredients.json b/tests/unit/expected_test_results/nutriscore/en-red-meat-ambiguous-category-no-ingredients.json index f1481da924d75..fde9a1b39e143 100644 --- a/tests/unit/expected_test_results/nutriscore/en-red-meat-ambiguous-category-no-ingredients.json +++ b/tests/unit/expected_test_results/nutriscore/en-red-meat-ambiguous-category-no-ingredients.json @@ -33,7 +33,6 @@ "en:fish-meat-eggs", "en:processed-meat" ], - "ingredients_lc" : "en", "lc" : "en", "misc_tags" : [ "en:nutrition-no-fiber", diff --git a/tests/unit/expected_test_results/nutriscore/en-red-meat-category-no-ingredients.json b/tests/unit/expected_test_results/nutriscore/en-red-meat-category-no-ingredients.json index aa2676e1cc627..99265f12404d9 100644 --- a/tests/unit/expected_test_results/nutriscore/en-red-meat-category-no-ingredients.json +++ b/tests/unit/expected_test_results/nutriscore/en-red-meat-category-no-ingredients.json @@ -43,7 +43,6 @@ "en:meat", "en:meat-other-than-poultry" ], - "ingredients_lc" : "en", "lc" : "en", "misc_tags" : [ "en:nutrition-no-fiber", diff --git a/tests/unit/expected_test_results/nutriscore/flavored-spring-water-no-nutrition.json b/tests/unit/expected_test_results/nutriscore/flavored-spring-water-no-nutrition.json index 5d77a95aefae6..1f5aa52775dec 100644 --- a/tests/unit/expected_test_results/nutriscore/flavored-spring-water-no-nutrition.json +++ b/tests/unit/expected_test_results/nutriscore/flavored-spring-water-no-nutrition.json @@ -40,7 +40,6 @@ "en:beverages", "en:waters-and-flavored-waters" ], - "ingredients_lc" : "en", "lc" : "en", "misc_tags" : [ "en:nutrition-not-enough-data-to-compute-nutrition-score", diff --git a/tests/unit/expected_test_results/nutriscore/flavored-spring-with-nutrition.json b/tests/unit/expected_test_results/nutriscore/flavored-spring-with-nutrition.json index c3f1f8fd2c2b4..571f7d0e572f1 100644 --- a/tests/unit/expected_test_results/nutriscore/flavored-spring-with-nutrition.json +++ b/tests/unit/expected_test_results/nutriscore/flavored-spring-with-nutrition.json @@ -40,7 +40,6 @@ "en:beverages", "en:waters-and-flavored-waters" ], - "ingredients_lc" : "en", "lc" : "en", "misc_tags" : [ "en:nutriscore-computed", diff --git a/tests/unit/expected_test_results/nutriscore/olive-oil.json b/tests/unit/expected_test_results/nutriscore/olive-oil.json index 6962710fbd049..2c96b4af134ce 100644 --- a/tests/unit/expected_test_results/nutriscore/olive-oil.json +++ b/tests/unit/expected_test_results/nutriscore/olive-oil.json @@ -44,7 +44,6 @@ "en:fats-and-sauces", "en:fats" ], - "ingredients_lc" : "en", "lc" : "en", "misc_tags" : [ "en:nutriscore-computed", diff --git a/tests/unit/expected_test_results/nutriscore/spring-water-no-nutrition.json b/tests/unit/expected_test_results/nutriscore/spring-water-no-nutrition.json index ad5c148284e5b..2dbb73e574c70 100644 --- a/tests/unit/expected_test_results/nutriscore/spring-water-no-nutrition.json +++ b/tests/unit/expected_test_results/nutriscore/spring-water-no-nutrition.json @@ -38,7 +38,6 @@ "en:beverages", "en:waters-and-flavored-waters" ], - "ingredients_lc" : "en", "lc" : "en", "misc_tags" : [ "en:nutriscore-computed", diff --git a/tests/unit/expected_test_results/nutriscore/sunflower-oil-no-sugar-no-sat-fat.json b/tests/unit/expected_test_results/nutriscore/sunflower-oil-no-sugar-no-sat-fat.json index eb65ac8f832d1..80bb9e40e6125 100644 --- a/tests/unit/expected_test_results/nutriscore/sunflower-oil-no-sugar-no-sat-fat.json +++ b/tests/unit/expected_test_results/nutriscore/sunflower-oil-no-sugar-no-sat-fat.json @@ -44,7 +44,6 @@ "en:fats-and-sauces", "en:fats" ], - "ingredients_lc" : "en", "lc" : "en", "misc_tags" : [ "en:nutrition-not-enough-data-to-compute-nutrition-score", diff --git a/tests/unit/expected_test_results/nutriscore/sunflower-oil-no-sugar.json b/tests/unit/expected_test_results/nutriscore/sunflower-oil-no-sugar.json index 53774bafc10f0..f88309f540b96 100644 --- a/tests/unit/expected_test_results/nutriscore/sunflower-oil-no-sugar.json +++ b/tests/unit/expected_test_results/nutriscore/sunflower-oil-no-sugar.json @@ -44,7 +44,6 @@ "en:fats-and-sauces", "en:fats" ], - "ingredients_lc" : "en", "lc" : "en", "misc_tags" : [ "en:nutriscore-computed", diff --git a/tests/unit/expected_test_results/nutriscore/sunflower-oil.json b/tests/unit/expected_test_results/nutriscore/sunflower-oil.json index 555d2ef2d6d09..df87b83b4821d 100644 --- a/tests/unit/expected_test_results/nutriscore/sunflower-oil.json +++ b/tests/unit/expected_test_results/nutriscore/sunflower-oil.json @@ -44,7 +44,6 @@ "en:fats-and-sauces", "en:fats" ], - "ingredients_lc" : "en", "lc" : "en", "misc_tags" : [ "en:nutriscore-computed", diff --git a/tests/unit/expected_test_results/nutriscore/walnut-oil.json b/tests/unit/expected_test_results/nutriscore/walnut-oil.json index 7b82565d63c9f..94fb5351a835c 100644 --- a/tests/unit/expected_test_results/nutriscore/walnut-oil.json +++ b/tests/unit/expected_test_results/nutriscore/walnut-oil.json @@ -46,7 +46,6 @@ "en:fats-and-sauces", "en:fats" ], - "ingredients_lc" : "en", "lc" : "en", "misc_tags" : [ "en:nutriscore-computed", diff --git a/tests/unit/expected_test_results/recipes/fr-margherita-pizzas.fr-margherita-pizza-1.json b/tests/unit/expected_test_results/recipes/fr-margherita-pizzas.fr-margherita-pizza-1.json index 9871f723f02f6..c74c74163259e 100644 --- a/tests/unit/expected_test_results/recipes/fr-margherita-pizzas.fr-margherita-pizza-1.json +++ b/tests/unit/expected_test_results/recipes/fr-margherita-pizzas.fr-margherita-pizza-1.json @@ -150,6 +150,7 @@ "en:spice", "en:condiment" ], + "ingredients_lc" : "fr", "ingredients_n" : 9, "ingredients_n_tags" : [ "9", diff --git a/tests/unit/expected_test_results/recipes/fr-margherita-pizzas.fr-margherita-pizza-2-compound-ingredients.json b/tests/unit/expected_test_results/recipes/fr-margherita-pizzas.fr-margherita-pizza-2-compound-ingredients.json index d7860b150da7e..88286ede2e015 100644 --- a/tests/unit/expected_test_results/recipes/fr-margherita-pizzas.fr-margherita-pizza-2-compound-ingredients.json +++ b/tests/unit/expected_test_results/recipes/fr-margherita-pizzas.fr-margherita-pizza-2-compound-ingredients.json @@ -133,6 +133,7 @@ "en:water", "en:salt" ], + "ingredients_lc" : "fr", "ingredients_n" : 8, "ingredients_n_tags" : [ "8", diff --git a/tests/unit/expected_test_results/recipes/nectars.guava-nectar.json b/tests/unit/expected_test_results/recipes/nectars.guava-nectar.json index a63ac040c3500..f4af470c67f01 100644 --- a/tests/unit/expected_test_results/recipes/nectars.guava-nectar.json +++ b/tests/unit/expected_test_results/recipes/nectars.guava-nectar.json @@ -85,6 +85,7 @@ "en:e330", "en:some-unknown-ingredient" ], + "ingredients_lc" : "en", "ingredients_n" : 5, "ingredients_n_tags" : [ "5", diff --git a/tests/unit/expected_test_results/recipes/nectars.impossible-ingredients.json b/tests/unit/expected_test_results/recipes/nectars.impossible-ingredients.json index a400b3a087aac..adc97917d883f 100644 --- a/tests/unit/expected_test_results/recipes/nectars.impossible-ingredients.json +++ b/tests/unit/expected_test_results/recipes/nectars.impossible-ingredients.json @@ -51,6 +51,7 @@ "en:added-sugar", "en:disaccharide" ], + "ingredients_lc" : "en", "ingredients_n" : 3, "ingredients_n_tags" : [ "3", diff --git a/tests/unit/expected_test_results/recipes/nectars.strawberry-nectar.json b/tests/unit/expected_test_results/recipes/nectars.strawberry-nectar.json index 3c42f675c9025..ff07a68cdfd50 100644 --- a/tests/unit/expected_test_results/recipes/nectars.strawberry-nectar.json +++ b/tests/unit/expected_test_results/recipes/nectars.strawberry-nectar.json @@ -57,6 +57,7 @@ "en:added-sugar", "en:disaccharide" ], + "ingredients_lc" : "en", "ingredients_n" : 3, "ingredients_n_tags" : [ "3", diff --git a/tests/unit/ingredients_nesting.t b/tests/unit/ingredients_nesting.t index 505f77ca4fbf2..8313286c86655 100755 --- a/tests/unit/ingredients_nesting.t +++ b/tests/unit/ingredients_nesting.t @@ -440,7 +440,7 @@ foreach my $test_ref (@tests) { print STDERR "ingredients_text: " . $product_ref->{ingredients_text} . "\n"; - parse_ingredients_text_service($product_ref, {}); + parse_ingredients_text_service($product_ref, {}, {}); is($product_ref->{ingredients}, $expected_ingredients_ref) # using print + join instead of diag so that we don't have diff --git a/tests/unit/ingredients_parsing_todo.t b/tests/unit/ingredients_parsing_todo.t index 120f1feb06941..e665b297fe55e 100644 --- a/tests/unit/ingredients_parsing_todo.t +++ b/tests/unit/ingredients_parsing_todo.t @@ -181,7 +181,7 @@ foreach my $test_ref (@tests) { print STDERR "ingredients_text: " . $product_ref->{ingredients_text} . "\n"; - parse_ingredients_text_service($product_ref, {}); + parse_ingredients_text_service($product_ref, {}, {}); is($product_ref->{ingredients}, $expected_ingredients_ref) # using print + join instead of diag so that we don't have diff --git a/tests/unit/ingredients_percent.t b/tests/unit/ingredients_percent.t index 237b76dfac66c..dfe006e9db11e 100755 --- a/tests/unit/ingredients_percent.t +++ b/tests/unit/ingredients_percent.t @@ -279,8 +279,8 @@ foreach my $test_ref (@tests) { my $testid = $test_ref->[0]; my $product_ref = $test_ref->[1]; - parse_ingredients_text_service($product_ref, {}); - estimate_ingredients_percent_service($product_ref, {}); + parse_ingredients_text_service($product_ref, {}, {}); + estimate_ingredients_percent_service($product_ref, {}, {}); compare_to_expected_results( $product_ref->{ingredients}, diff --git a/tests/unit/ingredients_processing.t b/tests/unit/ingredients_processing.t index 0a01b37f718f5..6965af01a2a32 100755 --- a/tests/unit/ingredients_processing.t +++ b/tests/unit/ingredients_processing.t @@ -2742,7 +2742,7 @@ foreach my $test_ref (@tests) { print STDERR "ingredients_text: " . $product_ref->{ingredients_text} . "\n"; - parse_ingredients_text_service($product_ref, {}); + parse_ingredients_text_service($product_ref, {}, {}); is($product_ref->{ingredients}, $expected_ingredients_ref) diff --git a/tests/unit/nutrition_estimation.t b/tests/unit/nutrition_estimation.t index 1c8db19172de0..cab75f98534a3 100644 --- a/tests/unit/nutrition_estimation.t +++ b/tests/unit/nutrition_estimation.t @@ -41,7 +41,7 @@ foreach my $test_ref (@tests) { my $testid = $test_ref->{id}; my $product_ref = $test_ref->{product}; - parse_ingredients_text_service($product_ref, {}); + parse_ingredients_text_service($product_ref, {}, {}); if (compute_ingredients_percent_min_max_values(100, 100, $product_ref->{ingredients}) < 0) { delete_ingredients_percent_values($product_ref->{ingredients}); } diff --git a/tests/unit/parse_origins_from_text.t b/tests/unit/parse_origins_from_text.t index e89e08d071140..935c75705bdee 100644 --- a/tests/unit/parse_origins_from_text.t +++ b/tests/unit/parse_origins_from_text.t @@ -71,7 +71,7 @@ foreach my $test_ref (@tests) { my $product_ref = $test_ref->{product}; my $text = $product_ref->{"origin_" . $product_ref->{lc}}; - parse_origins_from_text($product_ref, $text); + parse_origins_from_text($product_ref, $text, $product_ref->{lc}); compare_to_expected_results($product_ref, "$expected_result_dir/$testid.json", $update_expected_results, $test_ref);