Changeset 519eaf5 for src/dgp/sgraph.cc
- Timestamp:
- 03/30/14 23:59:06 (11 years ago)
- Branches:
- master
- Children:
- 0a58b3f
- Parents:
- f924e4b
- git-author:
- Tomasz Obrebski <obrebski@…> (03/30/14 23:59:06)
- git-committer:
- Tomasz Obrebski <obrebski@…> (03/30/14 23:59:06)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/dgp/sgraph.cc
rb97a556 r519eaf5 29 29 30 30 newnode.edge.push_back(lastnodeind()); 31 32 newnode.edge_contains_self = true ; 31 33 32 34 return lastnodeind(); … … 85 87 //---------------------------------------------------------------------------------------------------- 86 88 87 void SGraph::print_arc(FILE* f, int head, int dep, Role role, int dir) // 0 - left, 1 - right89 void SGraph::print_arc(FILE* f, const char* msg, int head, int dep, Role role, int dir) // 0 - left, 1 - right 88 90 { 89 91 if(dir==0) 90 fprintf(f," #A %s:%d <-- %d\n", role.str(), dep, head);92 fprintf(f,"%s %s:%d <-- %d\n", msg, role.str(), dep, head); 91 93 else 92 fprintf(f," #A %s:%d --> %d\n", role.str(), head, dep);94 fprintf(f,"%s %s:%d --> %d\n", msg, role.str(), head, dep); 93 95 } 94 96 … … 113 115 for(vector<Arc>::iterator h=node.heads.begin(); h!=node.heads.end(); ++h) 114 116 { 115 // if(cont) buf+=sprintf(buf,","); else cont=true;116 117 buf+=sprintf(buf,"(++%s:%d)",h->role.str(),h->dst); 117 // buf+=sprintf(buf,"++%s-%d(%d~%d)",h->role.str(),h->dst,h->headanc,h->depanc);118 // buf+=sprintf(buf,"(<-%s-%d)",h->role.str(),h->dst);119 118 } 120 119 … … 122 121 for(vector<Arc>::iterator d=node.deps.begin(); d!=node.deps.end(); ++d) 123 122 { 124 // if(! nodes[d->dst].saturated()) continue; // NIE DRUKUJ NIENASYCONYCH PODRZEDNIKOW125 // if(cont) buf+=sprintf(buf,","); else cont=true;126 123 buf+=sprintf(buf,"(--%s:%d)",d->role.str(),d->dst); 127 // buf+=sprintf(buf,"--%s-%d(%d~%d)",d->role.str(),d->dst,d->headanc,d->depanc);128 // buf+=sprintf(buf,"(-%s->%d)",d->role.str(),d->dst);129 124 } 130 125 … … 177 172 { 178 173 char *buf0 = buf; 179 buf+=sprintf(buf,"#%s",pref); 180 181 buf+=sprintf(buf,"%-16s",form(n)); 182 174 buf+=sprintf(buf,"%-10s",pref); 175 buf+=sprintf(buf,"%d.%s",n,form(n)); 176 buf+=sprintf(buf,";"); 177 buf+=sprintf(buf,"%s ",cat(n).str()); 178 while(buf-buf0<40) buf+=sprintf(buf," "); 183 179 buf+=sprint_node(buf,n,anc,HEADS|DEPS|SETS|CONSTRAINTS); 184 180 185 buf+=sprintf(buf,"/");186 for(vector<int>::iterator e = nodes[n].edge.begin(); e != nodes[n].edge.end(); e++ )187 buf += sprintf(buf,"%d ", *e);181 // buf+=sprintf(buf,"/"); 182 // for(vector<int>::iterator e = nodes[n].edge.begin(); e != nodes[n].edge.end(); e++ ) 183 // buf += sprintf(buf,"%d ", *e); 188 184 189 185 buf+=sprintf(buf,"\n");
Note: See TracChangeset
for help on using the changeset viewer.