From: Tara L Andrews Date: Fri, 30 Sep 2011 00:27:26 +0000 (+0200) Subject: Bugfix for superfluous a.c. witnesses X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=78fab1cfdc157b4bb9029bad945195d6e617bf2b;p=scpubgit%2Fstemmatology.git Bugfix for superfluous a.c. witnesses --- diff --git a/lib/Text/Tradition/Parser/TEI.pm b/lib/Text/Tradition/Parser/TEI.pm index 0af2e64..5254ea0 100644 --- a/lib/Text/Tradition/Parser/TEI.pm +++ b/lib/Text/Tradition/Parser/TEI.pm @@ -131,6 +131,7 @@ sub parse { } $source = $rdg; } + print STDERR "Adding a.c. version for witness $sig\n"; $tradition->witness( $sig )->uncorrected_path( \@uncorrected ); } } @@ -149,7 +150,8 @@ sub _clean_sequence { if( $rdg =~ /^PH-(.*)$/ ) { # It is a placeholder. Keep it only if we need it. my $app_id = $1; - if( exists $app_ac->{$wit}->{$app_id} ) { + if( exists $app_ac->{$wit} && + exists $app_ac->{$wit}->{$app_id} ) { print STDERR "Retaining empty placeholder for $app_id\n"; push( @clean_sequence, $rdg ); }