From: Tara L Andrews Date: Mon, 16 Jan 2012 00:19:20 +0000 (+0100) Subject: recalculate ranks with each new relationship, for now X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=64ae627022a1c1607813e2a4ad61211e40f57eb3;p=scpubgit%2Fstemmatology.git recalculate ranks with each new relationship, for now --- diff --git a/lib/Text/Tradition/Collation.pm b/lib/Text/Tradition/Collation.pm index 6ae4f2d..2743526 100644 --- a/lib/Text/Tradition/Collation.pm +++ b/lib/Text/Tradition/Collation.pm @@ -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 )