- Timestamp:
- 01/17/13 20:50:41 (12 years ago)
- Branches:
- master
- Children:
- d2f119e
- Parents:
- 555c7f8
- git-author:
- Tomasz Obrebski <to@…> (01/17/13 20:50:41)
- git-committer:
- Tomasz Obrebski <to@…> (01/17/13 20:50:41)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/tre/tre
re7de6cc r3b02b04 156 156 for t in trees 157 157 $count += 1 158 t1=ground(t) 158 # t1=ground(t) 159 160 t1=t 159 161 160 162 span = $FOREST ? " span:" + (ground_tree_min(t1).to_s + ","+ground_tree_max(t1).to_s)+";" : "" … … 170 172 when /h/ 171 173 print "#\n# tree #{$count}\n# ------\n" 172 printtree (t1[0],t1[1],0)174 printtree_dgp(t1[0],t1[1],0) 173 175 end 174 176 end … … 178 180 def nodeinfo(id) 179 181 info="" 182 gphid = $gphid[id] 180 183 if $INFO =~ /o/ 181 info += $ord1[ id].to_s184 info += $ord1[gphid].to_s + '/' + gphid.to_s + '/' + id.to_s 182 185 info += '.' if $INFO =~ /[nfm]/ 183 186 end 184 187 if $INFO =~ /n/ 185 info += id.to_s188 info += gphid.to_s 186 189 info += '.' if $INFO =~ /[fm]/ 187 190 end 188 191 if $INFO =~ /f/ 189 info += $form[ id]192 info += $form[gphid] 190 193 info += ';' if $INFO =~ /m/ 191 194 end 192 195 if $INFO =~ /m/ 193 info += $lem[ id]196 info += $lem[gphid] 194 197 end 195 198 info … … 215 218 print "%-16s" % (arc[2]+": ") 216 219 printtree(arc[1],arcs,o+1) 220 end 221 end 222 223 def printtree_dgp(root,arcs,o) 224 if o==0 225 print "%-16s" % "root: " 226 end 227 print nodeinfo(root),"\n" 228 for arc in arcs.select{ |a| a[0]==root }.sort{|a,b| a[1]<=>b[1] } 229 print " "*(o+1) 230 print "%-16s" % (arc[2]+": ") 231 printtree_dgp(arc[1],arcs,o+1) 217 232 end 218 233 end … … 341 356 def gentrees2 bos, eos 342 357 $thetrees=[]; 343 roots = ( 1...eos).select{|i| $vis.include? [i,eos]}.select{|i| $vis.include? [bos,i]}358 roots = (bos..eos).select{|i| $vis.include? [i,eos]}.select{|i| $vis.include? [bos,i]} 344 359 345 360 if $DEBUG then print "ROOTS: #{roots.inspect}\n" end … … 363 378 if $DEBUG then print "buildR--#{min}--#{max}--#{tree.inspect}\n" end 364 379 trees=[] 365 for a in $arcs.select{|a| a[0]==max && $vis.include?([min,a[1]]) } 366 if $DEBUG then print "ARC: #{a.inspect}\n" end 367 for r in buildR(a[4],a[3],tree+[a]) #!!! buildR(a[1],a[3],tree+[a]) 380 for arc in $arcs.select{|a| a[0]==max && $vis.include?([min,a[1]]) } 381 if $DEBUG then print "ARC: #{arc.inspect}\n" end 382 for r in buildR(arc[1],arc[0],tree+[arc]) #!!! buildR(a[1],a[3],tree+[a]) 383 # for r in buildR(arc[4],arc[3],tree+[arc]) #!!! buildR(a[1],a[3],tree+[a]) 368 384 (rmin,rmax,rarcs) = r 369 385 for l in buildR(min,rmin,rarcs) … … 395 411 for arc in $arcs.select{|a| a[1]==max && $lhs.include?([min,a[0]]) } 396 412 if $DEBUG then print "ARC: #{arc.inspect}\n" end 397 for r in buildR(arc[3],arc[4],tree+[arc]) ### buildR(arc[3],max,tree+[arc]) 413 for r in buildR(arc[0],arc[1],tree+[arc]) ### buildR(arc[3],max,tree+[arc]) 414 #for r in buildR(arc[3],arc[4],tree+[arc]) ### buildR(arc[3],max,tree+[arc]) 398 415 (rmin,rmax,rarcs) = r 399 416 for l in buildL(min,rmin,rarcs)
Note: See TracChangeset
for help on using the changeset viewer.