From: Tara L Andrews Date: Fri, 3 Feb 2012 21:29:00 +0000 (+0100) Subject: keep from stripping meta readings, oops X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=32e95735ac76d04e2926965bcfd50a9f1afd3357;p=scpubgit%2Fstemmatology.git keep from stripping meta readings, oops --- diff --git a/lib/Text/Tradition/Collation/RelationshipStore.pm b/lib/Text/Tradition/Collation/RelationshipStore.pm index 367cbf8..b5e2e53 100644 --- a/lib/Text/Tradition/Collation/RelationshipStore.pm +++ b/lib/Text/Tradition/Collation/RelationshipStore.pm @@ -267,6 +267,7 @@ sub relationship_valid { if ( $rel eq 'transposition' || $rel eq 'repetition' ) { # Check that the two readings do (for a repetition) or do not (for # a transposition) appear in the same witness. + # TODO this might be called before witness paths are set... my %seen_wits; map { $seen_wits{$_} = 1 } $c->reading_witnesses( $source ); foreach my $w ( $c->reading_witnesses( $target ) ) { diff --git a/script/strip_punctuation.pl b/script/strip_punctuation.pl index 2b4ec62..fceb484 100755 --- a/script/strip_punctuation.pl +++ b/script/strip_punctuation.pl @@ -5,6 +5,8 @@ use strict; use warnings; use Text::Tradition::Directory; +binmode STDERR, ':utf8'; + my( $dsn, $user, $pass ) = @ARGV; my $connect_args = { dsn => $dsn }; @@ -17,6 +19,7 @@ foreach my $id ( $dir->tradition_ids ) { my $tradition = $dir->lookup( $id ); print STDERR "Processing tradition " . $tradition->name . "\n"; foreach my $reading ( $tradition->collation->readings ) { + next if $reading->is_meta; $reading->alter_text( strip_punct( $reading->text ) ); } $tradition->collation->flatten_ranks;