openfoodfacts / open-prices-frontend

A vue.js front-end for Open Prices
17 stars 11 forks source link

Raw / bulk products: add missing categories #262

Open raphodn opened 5 months ago

raphodn commented 5 months ago

Story

Following #30 & #87

https://raw.githubusercontent.com/openfoodfacts/openfoodfacts-server/main/taxonomies/food/categories.txt

Some categories in the price category choices are missing :

And some categories need to be removed :

raphodn commented 3 months ago
raphodn commented 2 months ago

problem with typeahead and accents

serpico commented 1 month ago

edit: after reading raphodn's explanations here it feels like an overkill to include all https://world.openfoodfacts.org/category/prepared-meats which seems to match most of the cases I mentioned here ( provided a few items would be added to the taxonomy ) but then it would be true as well for many cheeses when some user buying his cheeses à la coupe will dive into O-P - for the foreseeable future I'm ok waiting until O-P get's a little bit more integrated with the smooth-app.

aleene commented 1 month ago

I assume these are missing from the selection on Prices. We could add a special parent category to the taxonomy for products that are sold per weight (fresh vegetables, etc,) and individually (croissant, baguette, hot coffee, etc). And where weight is more appropriate (EAN with multiple weight/prices).

serpico commented 1 month ago

Is there a way to displays all the available types of pomme de terre/pommes de terre regardless of which one of those 2 spellings the user type ? Currently :

raphodn commented 1 month ago

fyi the current list of categories is here (a folder, with 1 file per language code) https://github.com/openfoodfacts/open-prices-frontend/tree/master/src/data/categories

it is generated after running this script https://github.com/openfoodfacts/open-prices-frontend/blob/master/data/categories/filter_categories.py see PR #273 for more details

for filtering we use this Vuetify component https://vuetifyjs.com/en/components/autocompletes/ not sure if it manages "fuzzy" search easily

raphodn commented 1 month ago

List of root categories (nodes without parents)

en:fresh-foods
en:stuffing
en:mountain-products
en:breaded-products
en:bread-coverings
en:snacks
en:cocoa-and-its-products
en:plant-based-foods-and-beverages
en:specific-products
fr:premier-cru
en:syrups
fr:de-matieres-grasses
en:meats-and-their-products
en:caviar-substitutes
ru:молоко-питьевое-с-массовой-долей-жира-от-4-7-до-7-0-ультрапастеризованное
en:pasteurised
en:sweet-pies
en:canned-foods
en:sweeteners
en:cooking-helpers
en:food-decorations
fi:hapatettu
fi:hapatetut
en:condiments
fr:poulet-crudites
ru:икра-овощная
en:pies
en:fried-foods
en:desserts
en:baby-foods
en:farming-products
en:freeze-dried-foods
en:brick-sheets
en:broths
en:bee-products
en:artisan-products
en:seafood
fr:conserve
fi:ruoat
en:skewers
en:chips-and-fries
en:meal-kits
en:meat-alternatives
en:frozen-foods
en:flavoured
en:dietary-supplements
en:breakfasts
en:fish-and-meat-and-eggs
en:fats
en:terrines
en:crepes-and-galettes
en:purees
en:spreads
en:capsules
en:dried-products
en:fermented-foods
en:festive-foods
ru:молоко-питьевое-с-массовой-долей-жира-от-4-7-до-7-0
fr:thon-crudites
en:dairies
en:meals
en:unpasteurised
en:hash-browns
en:refrigerated-foods
en:sandwich-made-with-french-bread
en:non-food-products
en:frozen-fruits-with-added-sugar
en:food-additives
en:sandwiches
en:beverages
aleene commented 1 month ago

Thanks for the list. I will relove some.

aleene commented 1 month ago

The list has many errors as the synonyms have been included.

raphodn commented 1 month ago

Fyi i put this list for information, but the script that filters the categories only selects a subset of these. So in the Prices app there isn't as many categories thankfully :)

aleene commented 1 month ago

I could add the parameter sales-format to entries in the category taxonomy. This could have values package, item or weight. The parameter is inheritable, so at a node, implies all children have the same values. A child could overrule maybe. I could start adding these based on the categories you already identified.

raphodn commented 1 month ago

https://github.com/openfoodfacts/openfoodfacts-server/pull/10412