From b97a55609b527df1f92edbe0c70d03a6385c0132 Mon Sep 17 00:00:00 2001 From: Tomasz Obrebski Date: Tue, 19 Nov 2013 09:55:00 +0100 Subject: [PATCH] drobiazgi w dgp --- src/dgp/dgp1.cc | 12 ++++++------ src/dgp/sgraph.cc | 12 ++++++++---- src/rm12/rm12 | 2 +- src/tre/tre | 10 ++++++---- 4 files changed, 21 insertions(+), 15 deletions(-) diff --git a/src/dgp/dgp1.cc b/src/dgp/dgp1.cc index bb3a19a..6308b26 100644 --- a/src/dgp/dgp1.cc +++ b/src/dgp/dgp1.cc @@ -172,7 +172,7 @@ int create_new_head_node_left(int h, NodeProp& newheadprop, bitset& ne create_reverse_links(newheadind); if(debug) sgraph.print_node_debug(stderr,"C ",newheadind,h); - if(debug) print_sets(newheadind); + // if(debug) print_sets(newheadind); return newheadind; } @@ -191,7 +191,7 @@ int create_new_dep_node_left(int d, NodeProp& prop, bitset& LH, bitset create_reverse_links(newind); if(debug) sgraph.print_node_debug(stderr,"C ",newind,d); - if(debug) print_sets(newind); + // if(debug) print_sets(newind); return newind; } @@ -211,7 +211,7 @@ int create_new_head_node_right(int h, NodeProp& newheadprop, bitset& n create_reverse_links(newheadind); if(debug) sgraph.print_node_debug(stderr,"C ",newheadind,h); - if(debug) print_sets(newheadind); + // if(debug) print_sets(newheadind); return newheadind; } @@ -229,7 +229,7 @@ int create_new_dep_node_right(int d, NodeProp& prop, bitset& LH, bitse create_reverse_links(newind); if(debug) sgraph.print_node_debug(stderr,"C ",newind,d); - if(debug) print_sets(newind); + // if(debug) print_sets(newind); return newind; } @@ -303,9 +303,9 @@ void connect_left(int h, int d, const Link& l, list& new_head_boubbles if(debug) sgraph.print_arc(stderr,newheadind,d,l.role,0); if(debug) sgraph.print_node_debug(stderr,"U ",newheadind,h); - if(debug) print_sets(newheadind); + // if(debug) print_sets(newheadind); if(debug) sgraph.print_node_debug(stderr,"U ",newdepind,d); - if(debug) print_sets(newdepind); + // if(debug) print_sets(newdepind); } //---------------------------------------------------------------------------------------------------- diff --git a/src/dgp/sgraph.cc b/src/dgp/sgraph.cc index 173f8cc..2d97546 100644 --- a/src/dgp/sgraph.cc +++ b/src/dgp/sgraph.cc @@ -112,16 +112,20 @@ int SGraph::sprint_node(char* buf, int nodeind, int anc, unsigned int info) if (info&HEADS) for(vector::iterator h=node.heads.begin(); h!=node.heads.end(); ++h) { - if(cont) buf+=sprintf(buf,","); else cont=true; - buf+=sprintf(buf,"++%s-%d(%d~%d)",h->role.str(),h->dst,h->headanc,h->depanc); + // if(cont) buf+=sprintf(buf,","); else cont=true; + buf+=sprintf(buf,"(++%s:%d)",h->role.str(),h->dst); + // buf+=sprintf(buf,"++%s-%d(%d~%d)",h->role.str(),h->dst,h->headanc,h->depanc); + // buf+=sprintf(buf,"(<-%s-%d)",h->role.str(),h->dst); } if (info&DEPS) for(vector::iterator d=node.deps.begin(); d!=node.deps.end(); ++d) { // if(! nodes[d->dst].saturated()) continue; // NIE DRUKUJ NIENASYCONYCH PODRZEDNIKOW - if(cont) buf+=sprintf(buf,","); else cont=true; - buf+=sprintf(buf,"--%s-%d(%d~%d)",d->role.str(),d->dst,d->headanc,d->depanc); + // if(cont) buf+=sprintf(buf,","); else cont=true; + buf+=sprintf(buf,"(--%s:%d)",d->role.str(),d->dst); + // buf+=sprintf(buf,"--%s-%d(%d~%d)",d->role.str(),d->dst,d->headanc,d->depanc); + // buf+=sprintf(buf,"(-%s->%d)",d->role.str(),d->dst); } if (info&SETS) diff --git a/src/rm12/rm12 b/src/rm12/rm12 index b1b4fec..d4c83fc 100755 --- a/src/rm12/rm12 +++ b/src/rm12/rm12 @@ -7,4 +7,4 @@ /[0-9]+[ \t]+[0-9]+[ \t]+BOS/! -s/[0-9]+[ \t]+[0-9]+[ \t]// +s/[0-9]+[ \t]+[0-9]+[ \t]// \ No newline at end of file diff --git a/src/tre/tre b/src/tre/tre index d03775b..5ab399a 100755 --- a/src/tre/tre +++ b/src/tre/tre @@ -20,7 +20,7 @@ opts = GetoptLong.new( $helptext= "The program generates trees from the graph output by dgp. dgp must\n"+ -"must be run with '-i ds' option.\n\n"+ +"must be run with '--info=ds' option.\n\n"+ "Command: tre [options]\n\n"+ "Options:\n"+ "--help -h Print help (this text) and exit.\n"+ @@ -268,7 +268,7 @@ def parsegraph(nodes) parts = dgp[2].split($dgpsep,7) if parts[3]==nil || parts[4]==nil || parts[5]==nil - $stderr.print "ERR: tre requires dgp be called with '--info s' option. Aborting.\n" + $stderr.print "ERR: tre requires dgp be called with '--info=ds' option. Aborting.\n" exit end @@ -279,9 +279,11 @@ def parsegraph(nodes) $arcs |= parts[2].split(',').map{ |a| case a when /\-\-(\w+)-(\d+)\((\d+)~(\d+)\)/ - [i, $2.to_i, $1, $3.to_i, $4.to_i] + # [i, $2.to_i, $1, $3.to_i, $4.to_i] + [i, $2.to_i, $1, 0, 0] when /\+\+(\w+)-(\d+)\((\d+)~(\d+)\)/ - [$2.to_i, i, $1, $3.to_i, $4.to_i] + # [$2.to_i, i, $1, $3.to_i, $4.to_i] + [$2.to_i, i, $1, 0, 0] end } $succ |= parts[3][1..-2].split(',').map{|x| [x.to_i,i]} $vis |= parts[4][1..-2].split(',').map{|x| [x.to_i,i]}