Did I find the right examples for you? yes no

All Samples(2)  |  Call(2)  |  Derive(0)  |  Import(0)
transform indirect complement to relative
Input=sentence and verbal class         Output=sentence and verbal class         

        def correct_i_compl(phrase, verb):
    """
    transform indirect complement to relative
    Input=sentence and verbal class         Output=sentence and verbal class         
    """

    #If we have a direct transitive verb
    if verb in ResourcePool().direct_transitive:

        #init
        x = 0
        while x < len(phrase):
            #If there is a proposal with an adverbial
            if x + 1 < len(phrase) and phrase[x] in ResourcePool().compelement_proposals:
                #If there is a plural
                phrase = phrase[:x] + analyse_nominal_group.find_plural(phrase[x:])

                if analyse_nominal_group.find_sn_pos(phrase, x + 1):
                    adverbial = analyse_nominal_group.find_sn_pos(phrase, x + 1)
                    begin_pos = x - 1

                    #We will find the subject of the relative
                    while not analyse_nominal_group.find_sn_pos(phrase, begin_pos):
                        begin_pos -= 1
                    nom_gr = analyse_nominal_group.find_sn_pos(phrase, begin_pos)

                    #If there nominal group is just before the adverbial
                    if begin_pos + len(nom_gr) == x:
                        phrase = phrase[:x] + ['which', 'is'] + [phrase[x]] + adverbial + [';'] + phrase[x + len(
                            adverbial) + 1:]
            x += 1
    return phrase
        


src/d/i/Dialogs-0.13/src/dialogs/parsing/analyse_sentence.py   Dialogs(Download)
 
        #Process relative changes
        sentence = analyse_verbal_structure.correct_i_compl(sentence, vg.vrb_main[0])
 
        sentence = analyse_verbal_structure.process_compare(sentence, vg)
    if sentence != [] and vg.vrb_main != []:
        #Process relative changes
        sentence = analyse_verbal_structure.correct_i_compl(sentence, vg.vrb_main[0])
 
    sentence = analyse_verbal_structure.process_compare(sentence, vg)