X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FText%2FTradition%2FCollation%2FRelationshipStore.pm;h=2a0703a2f3e1dab054c1de5a036a5dfbb2465179;hb=3579c22be6d538476081f0a0dede988aa3f7acb9;hp=40aa684e821f219589d64b8b3e28f02f194f694c;hpb=10943ab0b79fbd489f6beb3b81a13ed8cbcfafcf;p=scpubgit%2Fstemmatology.git diff --git a/lib/Text/Tradition/Collation/RelationshipStore.pm b/lib/Text/Tradition/Collation/RelationshipStore.pm index 40aa684..2a0703a 100644 --- a/lib/Text/Tradition/Collation/RelationshipStore.pm +++ b/lib/Text/Tradition/Collation/RelationshipStore.pm @@ -565,7 +565,7 @@ sub relationship_valid { $mustdrop = [] unless $mustdrop; # in case we were passed nothing my $c = $self->collation; ## Assume validity is okay if we are initializing from scratch. - return ( 1, "initializing" ) unless $c->tradition->initialized; + return ( 1, "initializing" ) unless $c->tradition->_initialized; if ( $rel eq 'transposition' || $rel eq 'repetition' ) { # Check that the two readings do (for a repetition) or do not (for @@ -762,10 +762,12 @@ sub _remove_equivalence_node { my $group = $self->equivalence( $node ); my $nodelist = $self->eqreadings( $group ); if( @$nodelist == 1 && $nodelist->[0] eq $node ) { + $self->equivalence_graph->delete_vertex( $group ); $self->remove_eqreadings( $group ); + $self->remove_equivalence( $group ); } elsif( @$nodelist == 1 ) { - warn "DATA INCONSISTENCY in equivalence graph: " . $nodelist->[0] . - " in group that should have only $node"; + throw( "DATA INCONSISTENCY in equivalence graph: " . $nodelist->[0] . + " in group that should have only $node" ); } else { my @newlist = grep { $_ ne $node } @$nodelist; $self->set_eqreadings( $group, \@newlist ); @@ -835,7 +837,7 @@ sub _make_equivalence { $self->equivalence_graph->delete_vertex( $seq ); # TODO enable this after collation parsing is done throw( "Graph got disconnected making $source / $target equivalence" ) - if $self->_is_disconnected && $self->collation->tradition->initialized; + if $self->_is_disconnected && $self->collation->tradition->_initialized; } =head2 test_equivalence @@ -973,7 +975,7 @@ sub _break_equivalence { } # TODO enable this after collation parsing is done throw( "Graph got disconnected breaking $source / $target equivalence" ) - if $self->_is_disconnected && $self->collation->tradition->initialized; + if $self->_is_disconnected && $self->collation->tradition->_initialized; } sub _find_equiv_without {