From: Tara L Andrews Date: Sat, 10 Mar 2012 21:37:30 +0000 (+0100) Subject: make text_from_paths actually work X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=5164a6f0b55bed68d5ed83b19916196bf168a6d4;p=scpubgit%2Fstemmatology.git make text_from_paths actually work --- diff --git a/lib/Text/Tradition/Collation.pm b/lib/Text/Tradition/Collation.pm index 7176134..7e9a3a5 100644 --- a/lib/Text/Tradition/Collation.pm +++ b/lib/Text/Tradition/Collation.pm @@ -1627,14 +1627,22 @@ original texts. sub text_from_paths { my $self = shift; foreach my $wit ( $self->tradition->witnesses ) { - my @text = split( /\s+/, - $self->reading_sequence( $self->start, $self->end, $wit->sigil ) ); + my @readings = $self->reading_sequence( $self->start, $self->end, $wit->sigil ); + my @text; + foreach my $r ( @readings ) { + next if $r->is_meta; + push( @text, $r->text ); + } $wit->text( \@text ); if( $wit->is_layered ) { - my @uctext = split( /\s+/, - $self->reading_sequence( $self->start, $self->end, - $wit->sigil.$self->ac_label ) ); - $wit->text( \@uctext ); + my @ucrdgs = $self->reading_sequence( $self->start, $self->end, + $wit->sigil.$self->ac_label ); + my @uctext; + foreach my $r ( @ucrdgs ) { + next if $r->is_meta; + push( @uctext, $r->text ); + } + $wit->layertext( \@uctext ); } } }