2 Replies Latest reply on Nov 21, 2012 7:12 AM by comment

    Translate ingredientlists script

    spaartje

      Dear Developers,

       

      I have a filled a database with ingredients in 6 languages.

      For example, tomato is translated into Dutch, French, German, Spanish and Italian.

       

      My supplier deliver me an ingredientlists as 1 textfield and it looks like this:

       

      flavour enhancer: (monosodium glutamate, nucleotide seasoning), salt, ricepowder, sugar, flavouring: chicken, egg, spices, curry powder (contains turmeric),sesame oil, hydrolyzed vegetable protein (soy), white dextrin, vitamin B2

       

      All the ingredients can be found in the database but what is the best way to separate the ingedients and compare them with ingredients in the database?

      I thought up a plan to separate all the ingredients by searching for all comma's in the textfield but that will not help because there the textfield contains : and ( )

       

      Any help is appreciated

       

      Rgds Marcel

        • 1. Re: Translate ingredientlists script
          comment

          In your example, "flavour enhancer" is followed by a colon and parentheses. Presumably it contains monosodium glutamate and nucleotide seasoning - but not salt, which falls outside the parentheses. The word "flavouring" is also followed by a colon, but no parentheses - thus it is not clear what is included within the term.

           

          I don't think you will have much success telling a computer how to handle text that cannot be reliably handled by a human (a fairly stupid human, for that matter).

          • 2. Re: Translate ingredientlists script
            comment

            On second thought, if you ignore the internal hierarchy, you could treat the colon and the parentheses as separators - equal to the comma. That would give you a list of:

             

            • flavour enhancer
            • monosodium glutamate
            • nucleotide seasoning
            • salt
            • ricepowder
            • sugar
            • flavouring
            • chicken
            • egg
            • spices
            • curry powder
            • contains turmeric
            • sesame oil
            • hydrolyzed vegetable protein
            • soy
            • white dextrin
            • vitamin B2

             

            which could be further improved by substituting out words like "contains".

            1 of 1 people found this helpful