recalculate ranks with each new relationship, for now
Tara L Andrews [Mon, 16 Jan 2012 00:19:20 +0000 (01:19 +0100)]
lib/Text/Tradition/Collation.pm

index 6ae4f2d..2743526 100644 (file)
@@ -251,8 +251,11 @@ in Text::Tradition::Collation::Relationship.
 sub add_relationship {
        my $self = shift;
     my( $source, $target, $opts ) = $self->_stringify_args( @_ );
-    return $self->relations->add_relationship( $source, $self->reading( $source ),
-       $target, $self->reading( $target ), $opts );
+    my( $ret, @vectors ) = $self->relations->add_relationship( $source, 
+       $self->reading( $source ), $target, $self->reading( $target ), $opts );
+    # Force a full rank recalculation every time. Yuck.
+    $self->calculate_ranks() if $ret && $self->end->has_rank;
+    return( $ret, @vectors );
 }
 
 =head2 reading_witnesses( $reading )