Did I find the right examples for you? yes no

All Samples(1)  |  Call(1)  |  Derive(0)  |  Import(0)
distributes the sentence according to:                             
Their functionality and their type                                               
Input=sentence, beginning sentence list          Output=class Sentence           

        def dispatching(sentence):
    """
    distributes the sentence according to:                             
    Their functionality and their type                                               
    Input=sentence, beginning sentence list          Output=class Sentence           
    """

    if len(sentence) > 0:

        #For ending dialogue
        if sentence[0].endswith('bye'):
            return [Sentence(END, '', [], [])]

        #When others
        for x in ResourcePool().sentence_starts:
            #If we find a knowing case
            if sentence[0] == x[0]:


                #For
                if x[1] == '1':
                    return [Sentence(START, '', [], [])]

                #It's a w_question or subsentence
                if x[1] == '2':

                    #If there is which or no nominal group it is a question
                    if sentence[0] != 'which' and analyse_nominal_group.find_sn_pos(sentence, 1) != []:
                        #Here we have the condition of the subsentences
                        return [stc_start_subsentence(sentence)]

                    #For 'when'
                    if x[2] == '1':
                        #If we remove the first word => it becomes like y_n_question
                        return [y_n_ques(W_QUESTION, 'date', sentence[1:])]

                    #For 'where'
                    elif x[2] == '2':
                        return [w_quest_where(W_QUESTION, 'place', sentence)]

                    #For 'what'
                    elif x[2] == '3':
                        #Here we have to use a specific processing for 'type' and 'kind'
                        if sentence[1] == 'type' or sentence[1] == 'kind':
                            #We start by processing the end of the sentence like a y_n_question
                            return [w_quest_class(sentence)]

                        #For other type of 'what' question
                        else:
                            return [w_quest_what(W_QUESTION, sentence)]

                    #For 'how'
                    elif x[2] == '4':

                        if sentence[1] == 'many' or sentence[1] == 'much':
                            return [w_quest_quant(W_QUESTION, 'quantity', sentence)]

                        elif sentence[1] == 'about':
                            #We replace 'about' by 'is' to have a y_n_question
                            sentence[1] = 'is'
                            return [y_n_ques(W_QUESTION, 'invitation', sentence[1:])]

                        #For other type of 'how' question
                        else:
                            return [w_quest_how(W_QUESTION, sentence)]

                    #For 'why'
                    elif x[2] == '5':
                        return [y_n_ques(W_QUESTION, 'reason', sentence[1:])]

                    #For 'whose'
                    elif x[2] == '6':
                        return [w_quest_whose(W_QUESTION, 'owner', sentence)]

                    #For 'who'
                    elif x[2] == '7':
                        return [y_n_ques(W_QUESTION, 'people', sentence[1:])]

                    #For 'which'
                    elif x[2] == '8':
                        return [w_quest_which(W_QUESTION, 'choice', sentence[1:])]

                    #For 'to whom'
                    elif x[2] == '9':
                        return [w_quest_whom(W_QUESTION, 'people', sentence[1:])]

                #It's a y_n_question
                elif x[1] == '3':
                    return [y_n_ques(YES_NO_QUESTION, '', sentence)]

                #It's a conditional sentence
                elif x[1] == '4':
                    return [stc_start_subsentence(sentence)]

                #Agree
                elif x[1] == '5':
                    return separ_sentence(sentence, AGREEMENT)

                #Disagree
                elif x[1] == '6':
                    return separ_sentence(sentence, DISAGREEMENT)

                #Gratulation
                elif x[1] == '7':
                    return separ_sentence(sentence, GRATULATION)

                #Interjunction
                elif x[1] == '8':
                    return [exclama_sentence(sentence)]

        #For exclamatively
        if sentence[len(sentence) - 1] == '!':
            return [exclama_sentence(sentence)]

        #It's a statement or an imperative sentence
        return [other_sentence('', '', sentence)]

    #Default case
    return []
        


src/d/i/Dialogs-0.13/src/dialogs/parsing/analyse_verbal_structure.py   Dialogs(Download)
                    if w != 'which':
                        #We perform processing
                        vg.vrb_sub_sentence = vg.vrb_sub_sentence + analyse_sentence.dispatching(subsentence)
                        vg.vrb_sub_sentence[len(vg.vrb_sub_sentence) - 1].data_type = SUBSENTENCE + '+' + \
                                                                                      vg.vrb_sub_sentence[len(