From: Tara L Andrews Date: Mon, 16 Jan 2012 00:19:41 +0000 (+0100) Subject: return reading IDs, not reading objects, in vectors X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=cf6c01be953b7740c93a9403e0bd1dc57606e2dd;p=scpubgit%2Fstemmatology.git return reading IDs, not reading objects, in vectors --- diff --git a/lib/Text/Tradition/Collation/RelationshipStore.pm b/lib/Text/Tradition/Collation/RelationshipStore.pm index a07ace5..39bbdc0 100644 --- a/lib/Text/Tradition/Collation/RelationshipStore.pm +++ b/lib/Text/Tradition/Collation/RelationshipStore.pm @@ -163,6 +163,7 @@ sub add_relationship { my @identical_readings = grep { $_->text eq $relationship->reading_a } $c->readings; foreach my $ir ( @identical_readings ) { + next if $ir->id eq $source; # Check to see if there is a target reading with the same text at # the same rank. my @itarget = grep @@ -172,7 +173,7 @@ sub add_relationship { # We found a hit. warn "More than one reading with text " . $target_rdg->text . " at rank " . $ir->rank . "!" if @itarget > 1; - push( @vectors, [ $ir, $itarget[0] ] ); + push( @vectors, [ $ir->id, $itarget[0]->id ] ); } } }