revamp of Analysis.pm and associated changes
Tara L Andrews [Wed, 15 Feb 2012 21:14:37 +0000 (22:14 +0100)]
1  2 
lib/Text/Tradition/Collation.pm

@@@ -961,6 -961,7 +961,6 @@@ keys have a true hash value will be inc
  sub alignment_table {
      my( $self ) = @_;
      my $include; # see if we can ditch this
 -    ## DEBUG
      return $self->cached_table if $self->has_cached_table;
      
      # Make sure we can do this
@@@ -1474,7 -1475,9 +1474,9 @@@ sub calculate_common_readings 
        my @common;
        my $table = $self->alignment_table;
        foreach my $idx ( 0 .. $table->{'length'} - 1 ) {
-               my @row = map { $_->{'tokens'}->[$idx]->{'t'} } @{$table->{'alignment'}};
+               my @row = map { $_->{'tokens'}->[$idx] 
+                                                       ? $_->{'tokens'}->[$idx]->{'t'} : '' } 
+                                       @{$table->{'alignment'}};
                my %hash;
                foreach my $r ( @row ) {
                        if( $r ) {