From: tla Date: Fri, 15 Jun 2012 20:44:13 +0000 (+0200) Subject: stop making assumptions about relationship presence X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9f86af4b1f1fda84f9d0447910256d27a8e67e90;p=scpubgit%2Fstemmatology.git stop making assumptions about relationship presence --- diff --git a/script/orth_case_links.pl b/script/orth_case_links.pl index c86ec5c..efde97c 100755 --- a/script/orth_case_links.pl +++ b/script/orth_case_links.pl @@ -18,7 +18,7 @@ my $dir = Text::Tradition::Directory->new( $connect_args ); foreach my $text ( $dir->traditionlist ) { my $id = $text->{'id'}; - next unless $text->{'name'} =~ /punctuat/; + next unless $text->{'name'} =~ /Heinrichi/; my $scope = $dir->new_scope; my $tradition = $dir->lookup( $id ); print STDERR "Processing tradition " . $tradition->name . "\n"; @@ -38,11 +38,12 @@ foreach my $text ( $dir->traditionlist ) { . $r->text . ")\n"; $merged{$om->id} = 1; $c->merge_readings( $r, $om ); - } elsif ( !$c->get_relationship( $r, $om ) ) { + } else { print STDERR sprintf( "Adding orthographic link for %s and %s (%s / %s)\n", $r->id, $om->id, $r->text, $om->text ); - $c->add_relationship( $r, $om, - { 'type' => 'orthographic', 'scope' => 'global' } ); + eval { $c->add_relationship( $r, $om, + { 'type' => 'orthographic', 'scope' => 'global' } ); }; + print STDERR $@ if $@; } } }