Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: taxonomy enhancer #11267

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions cpanfile
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@ requires 'Module::Load';
# To measure the time taken by requests
requires 'Time::Monotonic';

# To measure similarity between words and find possible typo
requires 'Text::Levenshtein';

on 'test' => sub {
requires 'Test2::V0';
requires 'Mock::Quick';
Expand Down
5 changes: 5 additions & 0 deletions lib/ProductOpener/Products.pm
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ use ProductOpener::Units qw/normalize_product_quantity_and_serving_size/;
# may be moved to another module at some point
use ProductOpener::Packaging qw/analyze_and_combine_packaging_data/;
use ProductOpener::DataQuality qw/check_quality/;
use ProductOpener::TaxonomiesEnhancer qw/check_ingredients_between_languages/;

# Specific to the product type
use ProductOpener::FoodProducts qw/specific_processes_for_food_product/;
Expand Down Expand Up @@ -3751,6 +3752,10 @@ sub analyze_and_enrich_product_data ($product_ref, $response_ref) {

ProductOpener::DataQuality::check_quality($product_ref);

if (defined $taxonomy_fields{'ingredients'}) {
check_ingredients_between_languages($product_ref);
}

# Sort misc_tags in order to have a consistent order
if (defined $product_ref->{misc_tags}) {
$product_ref->{misc_tags} = [sort @{$product_ref->{misc_tags}}];
Expand Down
Loading
Loading