Did I find the right examples for you? yes no

All Samples(1)  |  Call(1)  |  Derive(0)  |  Import(0)
This function verbalises a question about quantity                               
Input=class sentence                              Output=sentence

        def quantity_ques(analysis):
    """
    This function verbalises a question about quantity                               
    Input=class sentence                              Output=sentence
    """

    #init
    phrase = []

    #We have to memorise the verb
    verb = other_functions.list_rebuilding(analysis.sv[0].vrb_main[0])

    if analysis.sv:
    #First case : aim is the subject with verb be
        if analysis.sv[0].d_obj == [] and (verb[0] == 'be' or (len(verb) > 1 and verb[1] == 'be')):
            phrase = statement(analysis)
            return ['how', 'much'] + phrase[1:len(phrase) - 1] + ['?']

        #Second case : aim is the subject without verb be
        elif not analysis.sv[0].d_obj:
            return ['how', 'much'] + y_o_question(analysis)

        #Third case : as yes no question without the direct complement
        else:
            subject = element_rebuilding.nom_struc_rebuilding(analysis.sn)

            #Same processing with yes no question
            phrase = element_rebuilding.vrb_ques_rebuilding(analysis.sv[0].vrb_tense, analysis.sv[0].vrb_main,
                                                            analysis.sv[0].vrb_adv, analysis.sn, analysis.sv[0].state,
                                                            analysis.aim)

            for x in analysis.sv[0].i_cmpl:
                phrase = phrase + element_rebuilding.indirect_compl_rebuilding(x)

            phrase = phrase + analysis.sv[0].advrb

            flag = 0
            for j in ResourcePool().verb_need_to:
                if analysis.sv[0].vrb_main[0] == j:
                    flag = 1

            for k in analysis.sv[0].sv_sec:
                phrase = element_rebuilding.scd_vrb_rebuilding(k, phrase, flag)

            for s in analysis.sv[0].vrb_sub_sentence:
                phrase = phrase + sub_process(s)

            #processing of the state
            if analysis.sv[0].state == Verbal_Group.negative:
                phrase = phrase[0:2] + subject + phrase[2:]
            else:
                phrase = [phrase[0]] + subject + phrase[1:]

            return ['how', 'much'] + analysis.sv[0].d_obj[0].noun + phrase + ['?']
        


src/d/i/Dialogs-0.13/src/dialogs/verbalization/utterance_rebuilding.py   Dialogs(Download)
 
        if analysis.aim == 'quantity':
            return sentence_rebuilding.quantity_ques(analysis)
 
        elif analysis.aim == 'choice':