Did I find the right examples for you? yes no

All Samples(36)  |  Call(36)  |  Derive(0)  |  Import(0)
breaks the utterance (as a list) into sentences
And does the processing of punctuation
Input=utterance and beginning sentence list         Output=list of sentence

        def process_sentence(utterance):
    """
    breaks the utterance (as a list) into sentences
    And does the processing of punctuation
    Input=utterance and beginning sentence list         Output=list of sentence
    """

    #init
    sentence = []
    sentence_list = []
    utterance = utterance.split()

    for j in utterance:

        #If user put space between the last word and the punctuation
        if j == '.' or j == '?' or j == '!':
            sentence = sentence + [j]
            sentence = processing(sentence)
            sentence_list = sentence_list + sentence
            sentence = []

        elif j.endswith('.') or j.endswith('?') or j.endswith('!'):
            sentence = sentence + [j[:len(j) - 1]] + [j[len(j) - 1]]
            sentence[len(sentence) - 2] = other_functions.get_off_point(sentence[len(sentence) - 2])
            sentence = processing(sentence)
            sentence_list = sentence_list + sentence
            sentence = []

        else:
            sentence = sentence + [j]

    #If the user forget the punctuation at the end
    if sentence:
        sentence = processing(sentence)
        sentence_list = sentence_list + sentence

    return sentence_list
        


src/d/i/Dialogs-0.13/src/dialogs/parsing/parser.py   Dialogs(Download)
        #Do all basic replacements (like capitals, n't -> not, etc) + splits in several
        #sentence with points.
        sentence_list = preprocessing.process_sentence(nl_input)
 
        return sentence_list

src/d/i/Dialogs-0.13/src/dialogs/sentence_test.py   Dialogs(Download)
    def check_valid(self, utterance, valid=True):
        sentence_list = preprocessing.process_sentence(utterance)
        sentences = analyse_sentence.sentences_analyzer(sentence_list)
 
        for s in sentences:
        logger.info('#################################################################\n')
 
        sentence_list = preprocessing.process_sentence(utterance)
        class_list = analyse_sentence.sentences_analyzer(sentence_list)
        flag = 'SUCCESS'
        logger.info('#################################################################\n')
 
        sentence_list = preprocessing.process_sentence(utterance)
        class_list = analyse_sentence.sentences_analyzer(sentence_list)
        flag = 'FAILURE'
        logger.info('#################################################################\n')
 
        sentence_list = preprocessing.process_sentence(utterance)
        class_list = analyse_sentence.sentences_analyzer(sentence_list)
        flag = 'SUCCESS'
        logger.info('#################################################################\n')
 
        sentence_list = preprocessing.process_sentence(utterance)
        class_list = analyse_sentence.sentences_analyzer(sentence_list)
        flag = 'FAILURE'

src/d/i/Dialogs-0.13/src/dialogs/interpretation/anaphora_test.py   Dialogs(Download)
        print(utterance)
        print('')
        sentence_list = preprocessing.process_sentence(utterance)
        class_list = analyse_sentence.sentences_analyzer(sentence_list)
 
        print(utterance)
        print('')
        sentence_list = preprocessing.process_sentence(utterance)
        class_list = analyse_sentence.sentences_analyzer(sentence_list)
 
        print(utterance)
        print('')
        sentence_list = preprocessing.process_sentence(utterance)
        class_list = analyse_sentence.sentences_analyzer(sentence_list)
 
        print(utterance)
        print('')
        sentence_list = preprocessing.process_sentence(utterance)
        class_list = analyse_sentence.sentences_analyzer(sentence_list)
 
        print(utterance)
        print('')
        sentence_list = preprocessing.process_sentence(utterance)
        class_list = analyse_sentence.sentences_analyzer(sentence_list)