Did I find the right examples for you? yes no

All Samples(3)  |  Call(3)  |  Derive(0)  |  Import(0)
Fills a structure Nominal_Group with given information

param: list phrase: the raw sentence
param: nom_gr: the nominal group
param: pos_nom_gr: its position
param: conjunction: 'and', 'or' or 'but'

:return: the nominal group class

        def fill_nom_gr(phrase, nom_gr, pos_nom_gr, conjunction):
    """Fills a structure Nominal_Group with given information

    param: list phrase: the raw sentence
    param: nom_gr: the nominal group
    param: pos_nom_gr: its position
    param: conjunction: 'and', 'or' or 'but'

    :return: the nominal group class
    """

    #init
    relative = []

    #We start by recovering all information we need
    nom_gr_compl = analyse_nominal_group.find_nom_gr_compl(nom_gr, phrase, pos_nom_gr)
    det = analyse_nominal_group.return_det(nom_gr)
    adj = analyse_nominal_group.return_adj(nom_gr)
    adj = analyse_nominal_group.convert_adj_to_digit(adj)
    noun = analyse_nominal_group.return_noun(nom_gr, adj, det)
    adj = analyse_nominal_group.process_adj_quantifier(adj)

    #We process the relative
    begin_pos_rel = analyse_nominal_group.find_relative(nom_gr, phrase, pos_nom_gr, ResourcePool().relatives)
    end_pos_rel = other_functions.recover_end_pos_sub(phrase[begin_pos_rel:], ResourcePool().relatives)

    #There is a relative
    if begin_pos_rel != -1:
        relative_phrase = phrase[begin_pos_rel + 1:begin_pos_rel + end_pos_rel - 1]
        relative_phrase = other_functions.recover_scd_verb_sub(relative_phrase)

        #If it is a place, we have not to duplicate the nominal group
        if phrase[begin_pos_rel] != 'where':
            relative_phrase = analyse_nominal_group.complete_relative(relative_phrase, nom_gr)

        relative = relative + [analyse_sentence.other_sentence(RELATIVE, phrase[begin_pos_rel], relative_phrase)]

    #If there is a nom_gr_compl, we must make a recursive process for embedded complement
    if nom_gr_compl:
        gn = Nominal_Group(det, noun, adj, [fill_nom_gr(phrase, nom_gr_compl, pos_nom_gr + len(nom_gr) + 1, 'AND')],
                           relative)

    else:
        gn = Nominal_Group(det, noun, adj, [], relative)

    #We recover the conjunction
    gn._conjunction = conjunction

    #We recover the quantifier
    recover_quantifier(gn)

    gn = put_rela_from_nncompl_noun(gn)
    return gn
        


src/d/i/Dialogs-0.13/src/dialogs/parsing/analyse_verbal_structure.py   Dialogs(Download)
                #Recovering nominal group
                gr_nom_list = gr_nom_list + [
                    analyse_nominal_structure.fill_nom_gr(phrase, object, pos_object, conjunction)]
 
                #We take off the nominal group
                #Recovering nominal group
                gr_nom_list = gr_nom_list + [
                    analyse_nominal_structure.fill_nom_gr(phrase, object, pos_object, conjunction)]
 
                #We take off the nominal group
                #Recovering nominal group
                gr_nom_list = gr_nom_list + [
                    analyse_nominal_structure.fill_nom_gr(sentence, object, i + 1, conjunction)]
                #We take off the nominal group
                sentence = analyse_nominal_group.take_off_nom_gr(sentence, object, i + 1)