def summarize_query(self, query):
        """
        Returns an utterance that rewords the inputted query as a form
        of acknowledgement to the user.
        """

        # if no criteria is provided, let the user know that every dish
        # will be searched
        if query == {}:
            return 'I will just look for every recipe we have.'

        summary = SPhraseSpec()
        summary.setSubject('I')
        summary.setVerb(random.choice(self.search_verbs))
        summary.setProgressive(gateway.jvm.java.lang.Boolean.TRUE)

        # add specified cuisines included, if they exist
        if 'include_cuisines' in query:
            for cuisine in query['include_cuisines']:
                if cuisine == query['include_cuisines'][-1]:
                    summary.addComplement(cuisine + ' dishes')
                else:
                    summary.addComplement(cuisine)
        else:
            summary.addComplement('recipes')

        # create phrase to include ingredients
        if 'include_ingredients' in query:
            ing_inc = PPPhraseSpec()
            ing_inc.setPreposition('that contain ')
            for ingredient in query['include_ingredients']:
                ing_inc.addComplement(ingredient)
            summary.addModifier(ing_inc)

        # create phrase to exclude ingredients
        if 'exclude_ingredients' in query:
            ing_exc = PPPhraseSpec()
            ing_exc.setPreposition('but do not contain')
            for ingredient in query['exclude_ingredients']:
                ing_exc.addComplement(ingredient)
            summary.addModifier(ing_exc)

        # create phrase to include recipe times and number of steps
        # and/or ingredients

        steps = SPhraseSpec()
        if 'prep_time' in query or 'cook_time' in query or 'total_time' in query or 'num_steps' in query or 'num_ingredients' in query:
            steps.setSubject('I')
            steps.setVerb(random.choice(self.search_verbs))
            steps.setProgressive(gateway.jvm.java.lang.Boolean.TRUE)
            steps.addPremodifier('also')

            steps_list = []
            if 'prep_time' in query and query['prep_time'] != None:
                steps_list.append('%i minutes to prepare' % query['prep_time'])
            if 'cook_time' in query and query['cook_time'] != None:
                steps_list.append('%i minutes to cook' % (query['cook_time']))
            if 'total_time' in query and query['total_time'] != None:
                steps_list.append('%i total minutes to make' %
                                  (query['total_time']))
            if 'num_steps' in query and query['num_steps'] != None:
                steps_list.append('%i steps to complete' %
                                  (query['num_steps']))
            if 'num_ingredients' in query and query['num_ingredients'] != None:
                steps_list.append('%i ingredients' %
                                  (query['num_ingredients']))
            for step in steps_list:
                if step == steps_list[0]:
                    steps.addComplement('recipes that require ' + step)
                else:
                    steps.addComplement(step)

        # tie everything together into one utterance
        final = TextSpec()
        final.addSpec(summary)
        final.addSpec(steps)
        final.setListConjunct('.')

        return self.clean_str(REALISER.realiseDocument(final).strip())
    def summarize_query(self, query):
        """
        Returns an utterance that rewords the inputted query as a form
        of acknowledgement to the user.
        """

        # if no criteria is provided, let the user know that every dish
        # will be searched
        if query == {}:
            return 'I will just look for every recipe we have.'

        summary = SPhraseSpec()
        summary.setSubject('I')
        summary.setVerb(random.choice(self.search_verbs))
        summary.setProgressive(gateway.jvm.java.lang.Boolean.TRUE)

        # add specified cuisines included, if they exist
        if 'include_cuisines' in query:
            for cuisine in query['include_cuisines']:
                if cuisine == query['include_cuisines'][-1]:
                    summary.addComplement(cuisine + ' dishes')
                else:
                    summary.addComplement(cuisine)
        else:
            summary.addComplement('recipes')

        # create phrase to include ingredients
        if 'include_ingredients' in query:
            ing_inc = PPPhraseSpec()
            ing_inc.setPreposition('that contain')
            for ingredient in query['include_ingredients']:
                ing_inc.addComplement(ingredient)
            summary.addModifier(ing_inc)

        # create phrase to exclude ingredients
        if 'exclude_ingredients' in query:
            ing_exc = PPPhraseSpec()
            ing_exc.setPreposition('but do not contain')
            for ingredient in query['exclude_ingredients']:
                ing_exc.addComplement(ingredient)
            summary.addModifier(ing_exc)

        # create phrase to include recipe times and number of steps
        # and/or ingredients

        steps = SPhraseSpec()
        if 'prep_time' in query or 'cook_time' in query or 'total_time' in query or 'num_steps' in query or 'num_ingredients' in query:
            steps.setSubject('I')
            steps.setVerb(random.choice(self.search_verbs))
            steps.setProgressive(gateway.jvm.java.lang.Boolean.TRUE)
            steps.addPremodifier('also')

            steps_list = []
            if 'prep_time' in query and query['prep_time'] != None:
                steps_list.append('%i minutes to prepare' % query['prep_time'])
            if 'cook_time' in query and query['cook_time'] != None:
                steps_list.append('%i minutes to cook' % (query['cook_time']))
            if 'total_time' in query and query['total_time'] != None:
                steps_list.append('%i total minutes to make' %
                                  (query['total_time']))
            if 'num_steps' in query and query['num_steps'] != None:
                steps_list.append('%i steps to complete' % (query['num_steps']))
            if 'num_ingredients' in query and query['num_ingredients'] != None:
                steps_list.append('%i ingredients' % (query['num_ingredients']))
            for step in steps_list:
                if step == steps_list[0]:
                    steps.addComplement('recipes that require ' + step)
                else:
                    steps.addComplement(step)

        # tie everything together into one utterance
        final = TextSpec()
        final.addSpec(summary)
        final.addSpec(steps)
        final.setListConjunct('.')

        return REALISER.realiseDocument(final).strip()