X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FText%2FTradition%2FCollation%2FRelationshipStore.pm;h=2479d08193e92240f2e3f163bf4c790b7d100e79;hb=83d5ac3af5c70f09ee081885efcba827fcef4cb4;hp=a07ace5ce374224c00706852fc23285c2fca5f2b;hpb=22222af93f90716e2ca05b2caa9166c845627114;p=scpubgit%2Fstemmatology.git diff --git a/lib/Text/Tradition/Collation/RelationshipStore.pm b/lib/Text/Tradition/Collation/RelationshipStore.pm index a07ace5..2479d08 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 ] ); } } } @@ -310,6 +311,10 @@ sub merge_readings { $self->delete_reading( $deleted ); } +sub as_graphml { ## TODO + return; +} + no Moose; __PACKAGE__->meta->make_immutable;