### TODO Check these figures
if( $t ) {
- is( scalar $t->collation->readings, 312, "Collation has all readings" );
- is( scalar $t->collation->paths, 363, "Collation has all paths" );
+ is( scalar $t->collation->readings, 311, "Collation has all readings" );
+ is( scalar $t->collation->paths, 361, "Collation has all paths" );
is( scalar $t->witnesses, 13, "Collation has all witnesses" );
}
my $last_rdg = shift @$p;
my $new_p = [ $last_rdg ];
foreach my $rdg ( @$p ) {
- if( $rdg->is_lacuna && $last_rdg->is_lacuna ) {
- # If we are in a lacuna already, drop this node.
- $c->del_reading( $rdg );
- } else {
- # Save the reading, lacuna or no.
- push( @$new_p, $rdg );
- $last_rdg = $rdg;
- }
+ # Omit the reading if we are in a lacuna already.
+ next if $rdg->is_lacuna && $last_rdg->is_lacuna;
+ # Save the reading otherwise.
+ push( @$new_p, $rdg );
+ $last_rdg = $rdg;
}
push( @$new_p, $c->end );
$wit->path( $new_p );
$main_wit->uncorrected_path( $ac_wit->path );
$tradition->del_witness( $ac_wit );
}
-
+
# Join up the paths.
$c->make_witness_paths;
+ # Delete our unused lacuna nodes.
+ foreach my $rdg ( grep { $_->is_lacuna } $c->readings ) {
+ $c->del_reading( $rdg ) unless $c->reading_witnesses( $rdg );
+ }
}
sub make_nodes {