openfoodfacts / openfoodfacts-server

Open Food Facts database, API server and web interface - 🐪🦋 Perl, CSS and JS coders welcome 😊 For helping in Python, see Robotoff or taxonomy-editor
GNU Affero General Public License v3.0
636 stars 372 forks source link

Consider removing normalize_percentage() calls from Tags.pm #2589

Closed stephanegigandet closed 4 years ago

stephanegigandet commented 4 years ago

normalize_percentages() is called a lot when building taxonomies and inside canonicalize_taxonomy_tag().

It is possible that it is not needed, or that we could find more efficient ways to deal with tags that contain the % sign.

Example categories tag that contain a % sign:

<en:Kefir
en:Kefir 2.5 %
de:Kefir 2.5 %
fr:Kéfir 2,5 %
ru:Кефир 2.5 %, Кефир 2.5%
aleene commented 4 years ago

Why not disallow such categories (for the moment)? Not sure if such granularity is useful.

stephanegigandet commented 4 years ago

@hangy : shall we close this issue now that you optimized normalize_percentages in https://github.com/openfoodfacts/openfoodfacts-server/pull/2593 ?