Did I find the right examples for you? yes no

All Samples(2)  |  Call(2)  |  Derive(0)  |  Import(0)
adds it or a determinant if it is necessary
Input=sentence                         Output=sentence       

        def create_nom_gr(sentence, aim):
    """
    adds it or a determinant if it is necessary
    Input=sentence                         Output=sentence       
    """

    if sentence[0] == '.' or sentence[0] == '?' or sentence[0] == '!' or sentence[0] == ';':
        return sentence[1:]

        #We delete word that we don't use
    if sentence[0] in ResourcePool().unusable_words:
        return sentence[1:]

        #Some word linked to the questions
    if sentence[0] == 'from' and aim == 'origin':
        return sentence[1:]

    #If we have a proposal
    if sentence[0] in ResourcePool().proposals:
        if sentence[1] != '.' and sentence[1] != '?' and sentence[1] != '!' and sentence[1] != ';':
            #We add a determinant
            sentence = [sentence[0]] + ['a'] + sentence[1:]
            sentence = [sentence[0]] + create_nom_gr_and(sentence[1:])
        else:
            #If we have a punctuation we add 'it', except if we
            # recognize it as an adverb.
            if sentence[0] in ResourcePool().adverbs_at_end:
                pass
            else:
                return [sentence[0]] + ['it'] + sentence[1:]
    else:
        #Default case : we add object
        sentence = ['a'] + sentence
        sentence = create_nom_gr_and(sentence)

    return sentence
        


src/d/i/Dialogs-0.13/src/dialogs/parsing/analyse_sentence.py   Dialogs(Download)
 
    while len(sentence) > 1:
        stc = analyse_verbal_structure.create_nom_gr(sentence, request)
        #We recover the direct, indirect complement and the adverbial
        stc = analyse_verbal_structure.recover_obj_iobj(stc, vg)
 
    while len(sentence) > 1:
        stc = analyse_verbal_structure.create_nom_gr(sentence, request)
        #We recover the direct, indirect complement and the adverbial
        stc = analyse_verbal_structure.recover_obj_iobj(stc, vg)