Changeset 854bece for src/dgp/dgp1.cc


Ignore:
Timestamp:
01/12/15 19:07:44 (10 years ago)
Author:
Tomasz Obrebski <obrebski@…>
Branches:
master
Children:
c03f8a5
Parents:
acbabee
git-author:
Tomasz Obrebski <obrebski@…> (01/12/15 19:07:44)
git-committer:
Tomasz Obrebski <obrebski@…> (01/12/15 19:07:44)
Message:

has_head prop added, visible_as_neighbour moved to prop

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/dgp/dgp1.cc

    racbabee r854bece  
    173173  int newd = find_existing_node(sgraph[d].mnode, new_dep_prop, new_dep_edge); 
    174174  if( newd < 0  ) 
    175     newd = create_new_node(d,new_dep_prop,new_dep_edge); 
     175    { 
     176      newd = create_new_node(d,new_dep_prop,new_dep_edge); 
     177      sgraph[newd].prop.has_head = true; 
     178    } 
    176179   
    177180  Edge new_head_edge(sgraph[newd].edge,newd); 
     
    201204 
    202205  Edge new_head_edge(sgraph[h].edge); 
    203   int newh = find_existing_node(sgraph[h].mnode, new_head_prop, new_head_edge); 
     206  int newh = -1; 
     207  if(!new_head_prop.forbidden[l.role]) newh = find_existing_node(sgraph[h].mnode, new_head_prop, new_head_edge); 
    204208  if( newh < 0 ) 
    205209      { 
    206210        newh = create_new_node(h,new_head_prop,new_head_edge); 
    207         sgraph[newh].visible_as_neighbour = false; 
     211        sgraph[newh].prop.visible_as_neighbour = false; 
    208212      } 
    209213 
    210214  Edge new_dep_edge; 
    211   int newd = find_existing_node(sgraph[d].mnode, new_dep_prop, new_dep_edge); 
    212   if( newd < 0) 
    213     newd = create_new_node(d,new_dep_prop,new_dep_edge); 
     215  int newd = d; 
     216  if( ! (new_dep_edge == sgraph[d].edge) || ! (old_dep_prop == new_dep_prop) ) 
     217    { 
     218      newd = create_new_node(d,new_dep_prop,new_dep_edge); 
     219      sgraph[newd].prop.has_head = true; 
     220    } 
    214221 
    215222 
     
    299306  int i; 
    300307  while((i=lvi.next()) >= 0) 
    301       if(sgraph.saturated(i)) 
     308    if(sgraph.saturated(i) && ! sgraph.has_head(i)) 
    302309        { 
    303310          if(debug) {fprintf(stderr,"\t%d <-- %d",i,j); } 
Note: See TracChangeset for help on using the changeset viewer.