Did I find the right examples for you? yes no

All Samples(2)  |  Call(2)  |  Derive(0)  |  Import(0)
This function verbalises an yes or no question                                   
Input=class sentence                              Output=sentence                

        def y_o_question(analysis):
    """
    This function verbalises an yes or no question                                   
    Input=class sentence                              Output=sentence                
    """

    #init
    phrase = []

    #Recovering the subject
    subject = element_rebuilding.nom_struc_rebuilding(analysis.sn)

    if analysis.sv:
        #Recovering the end of the sentence
        phrase = element_rebuilding.end_question_rebuilding(phrase, analysis.sv, analysis.sn, analysis.aim)

        #We need special processing to find the position of the subject
        if analysis.sv[0].state == Verbal_Group.negative:
            phrase = phrase[0:2] + subject + phrase[2:]
        else:
            phrase = [phrase[0]] + subject + phrase[1:]

        #Recovering subsentences
        for s in analysis.sv[0].vrb_sub_sentence:
            phrase = phrase + sub_process(s)
    else:
        phrase = subject

    #Eliminate redundancies if there are
    phrase = other_functions.eliminate_redundancy(phrase)

    #If it is a question about the origin
    if analysis.aim == 'origin':
        return phrase + ['from'] + ['?']

    return phrase + ['?']
        


src/d/i/Dialogs-0.13/src/dialogs/verbalization/utterance_rebuilding.py   Dialogs(Download)
    #For yes no question
    elif analysis.data_type == YES_NO_QUESTION:
        return sentence_rebuilding.y_o_question(analysis)
 
    #For start
        for x in wques_rules:
            if x[0] == analysis.aim:
                return x[1] + sentence_rebuilding.y_o_question(analysis)
 
        if analysis.aim == 'description':