From: Tara L Andrews Date: Wed, 21 Dec 2011 19:39:41 +0000 (+0100) Subject: we no longer use position; stop breaking relationship adding X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=decc2a201ca67a92814cba4963fea1dee7b47e92;p=scpubgit%2Fstemmatology.git we no longer use position; stop breaking relationship adding --- diff --git a/lib/Text/Tradition/Collation/Relationship.pm b/lib/Text/Tradition/Collation/Relationship.pm index 14e00fb..c2ad3ae 100644 --- a/lib/Text/Tradition/Collation/Relationship.pm +++ b/lib/Text/Tradition/Collation/Relationship.pm @@ -82,11 +82,6 @@ sub BUILD { $self->set_attribute( 'class', 'relationship' ); - my( $source, $target ) = @{$self->this_relation}; - if( $source->has_position && $target->has_position ) { - # Harmonize the positions. - $source->match_position( $target ); - } unless( $self->primary_relation ) { $self->primary_relation( [ $self->this_relation->[0]->label, $self->this_relation->[1]->label ] ); diff --git a/lib/Text/Tradition/Parser/Self.pm b/lib/Text/Tradition/Parser/Self.pm index 895ca4d..a34c9f5 100644 --- a/lib/Text/Tradition/Parser/Self.pm +++ b/lib/Text/Tradition/Parser/Self.pm @@ -201,7 +201,10 @@ sub parse { $opts->{'non_independent'} = $e->{'non_independent'} if exists $e->{'non_independent'}; warn "No relationship type for relationship edge!" unless $opts->{'type'}; - $collation->add_relationship( $from->{$IDKEY}, $to->{$IDKEY}, $opts ); + my( $ok, @result ) = $collation->add_relationship( $from->{$IDKEY}, $to->{$IDKEY}, $opts ); + unless( $ok ) { + warn "Did not add relationship: @result"; + } } }