Did I find the right examples for you? yes no

All Samples(71)  |  Call(71)  |  Derive(0)  |  Import(0)
This function is the basic function of this module                               
Input=class sentence                                       Output=sentence       

        def verbalising(class_list):
    """
    This function is the basic function of this module                               
    Input=class sentence                                       Output=sentence       
    """

    utterance = ''
    flag = i = 0

    #converting all classes sentence
    while i < len(class_list):
        if class_list[i].data_type == INTERJECTION:
            flag = 1

        if flag == 1 and class_list[i].data_type == IMPERATIVE:
            class_list[i].sn = []

        sentence = dispatching(class_list[i])

        if sentence:
            #To perform some changes to have an usual sentence at the end
            sentence = and_case(sentence)
            sentence = possesion_form(sentence)
            sentence = negation(sentence)
            if len(class_list[i].sn) < 2:
                sentence = replace_tuple(sentence)
            sentence = delete_plus(sentence)
            sentence = delete_comma(sentence)
            sentence = a_which_process(sentence)
            sentence = move_prep(sentence)

            if i > 0 and class_list[i - 1].data_type == INTERJECTION:
                utterance = utterance[:len(utterance) - 2] + ', '
            else:
            #To have the upper case
                sentence[0] = sentence[0][0].upper() + sentence[0][1:]

            #convert the list to string
            sentence = other_functions.convert_string(sentence)

            #To concatenate the last punctuation to the last word of the sentence
            sentence = sentence[:len(sentence) - 2] + sentence[len(sentence) - 1]

            #To separate with other sentences
            sentence += ' '

            utterance = utterance + sentence

        i += 1

    #To remove the last escape (at the end)
    return utterance[:len(utterance) - 1]
        


src/d/i/Dialogs-0.13/src/dialogs/verbalization/verbalization.py   Dialogs(Download)
    def verbalize(self, sentences):
        logger.debug("Verbalizing now...")
 
        nl_sentence = utterance_rebuilding.verbalising(sentences)
        logger.debug("Rebuild sentence to: \"" + nl_sentence + "\"")

src/d/i/Dialogs-0.13/src/dialogs/verbalization/verbalization_test.py   Dialogs(Download)
                                  [], [], Verbal_Group.affirmative, [])])]
 
        utterance = utterance_rebuilding.verbalising(sentences)
 
        logger.info("The original utterance is : " + original_utterance)
                                  [], [], Verbal_Group.affirmative, [])])]
 
        utterance = utterance_rebuilding.verbalising(sentences)
 
        logger.info("The original utterance is : " + original_utterance)
                                  [], [], Verbal_Group.negative, [])])]
 
        utterance = utterance_rebuilding.verbalising(sentences)
 
        logger.info("The original utterance is : " + original_utterance)
                                  [], [], Verbal_Group.affirmative, [])])]
 
        utterance = utterance_rebuilding.verbalising(sentences)
 
        logger.info("The original utterance is : " + original_utterance)
                                  [], [], Verbal_Group.affirmative, [])])]
 
        utterance = utterance_rebuilding.verbalising(sentences)
 
        logger.info("The original utterance is : " + original_utterance)